all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Ada Stevenson <adanskana@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Error handling when 'guix substitute' dies
Date: Sun, 24 Mar 2024 12:15:49 +0100	[thread overview]
Message-ID: <87le67rica.fsf@gnu.org> (raw)
In-Reply-To: <1843db1b-0ed0-7e77-5a31-de8ee9ca56a5@gmail.com> (Ada Stevenson's message of "Sun, 17 Mar 2024 06:18:51 +0000")

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

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 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 693 bytes --]

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)))

[-- Attachment #3: Type: text/plain, Size: 85 bytes --]


I’ll go ahead with this change if there are no objections.

Thanks,
Ludo’.

  parent reply	other threads:[~2024-03-24 11:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17  6:18 Error handling when 'guix substitute' dies Ada Stevenson
2024-03-17 11:45 ` Ekaitz Zarraga
2024-03-24 11:15 ` Ludovic Courtès [this message]
2024-03-25 10:12   ` Ada Stevenson
2024-03-29 15:10     ` Ludovic Courtès
2024-04-02  4:13       ` Philip McGrath
2024-04-10 13:47         ` Ludovic Courtès
2024-04-10 14:37           ` Christopher Baines
2024-04-02  8:42       ` Lars Bilke
2024-04-02  8:45         ` Ada Stevenson
2024-04-10 13:49         ` Ludovic Courtès
2024-03-26  8:32   ` Lars Bilke
  -- strict thread matches above, loose matches on Subject: below --
2024-05-28  1:02 Richard Sent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87le67rica.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=adanskana@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.