guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error handling when 'guix substitute' dies


From: Ada Stevenson
Subject: Re: Error handling when 'guix substitute' dies
Date: Mon, 25 Mar 2024 10:12:22 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

Hi Ludo',

On 3/24/24 11:15 AM, Ludovic Courtès wrote:
Hi Ada,

Ada Stevenson <adanskana@gmail.com> skribis:

Sometimes, usually when I'm on an enterprise network like my
university's of library's wifi, the `guix substitute` process dies
with a "TLS error in procedure 'write_to_session_record_port': Error
in the push function" error message. My connection is rock-solid
otherwise, and sometimes it doesn't happen at all.
What version of guix-daemon are you using?  Was it installed through
‘guix pull’ or via another distro?

I’ve seen this before but I haven’t experienced it in a long time, so I
wonder if I’m just lucky or if there are other factors at play.
I'm running the up-to-date daemon, 1.4.0-18.4c94b9e, on Guix System.

I'm not sure if this is a fault in the actual Guix code, or there's
some Guile library somewhere that has this bug. Anyway, I think it
would be a useful feature to have a way to automatically restart the
`guix substitute` process or otherwise recover from this error. Some
sort of `--restart=no.restarts.permitted` flag. Whenever I'm updating
my system I tend to leave and do something else, and when this happens
I come back and nothing's actually been done, and the error is
transient so I don't gain anything from seeing this message.
‘guix substitute’ is a ‘guix-daemon’ helper, which automatically
(re)starts it when needed.

Now, what we could do is have ‘guix substitute’ gracefully handle those
errors and keep going.  I believe this one-liner should do it:


diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 37cd08e289..3af0bf0019 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -494,7 +494,9 @@ (define* (download-nar narinfo destination
    (define (try-fetch choices)
      (match choices
        (((uri compression file-size) rest ...)
-       (guard (c ((and (pair? rest) (http-get-error? c))
+       (guard (c ((and (pair? rest)
+                       (or (http-get-error? c)
+                           (network-error? c)))
                    (warning (G_ "download from '~a' failed, trying next URL~%")
                             (uri->string uri))
                    (try-fetch rest)))

I’ll go ahead with this change if there are no objections.
Looks good to me! Thanks for looking into this :)

Thanks,
Ludo’.

Thanks,

Ada




reply via email to

[Prev in Thread] Current Thread [Next in Thread]