Subject: Bad error reporting in case of 404 during downloading

From: Maxime Devos <[email-masked]>
Date: Tue, 30 May 2023 00:05:26 +0200

$ guix system build /etc/config.scm:

  guix-1.4.0-6.dc5430c  52.2MiB 
  811.7Mi guix-1.4.0-6.dc5430c  52.2MiB 
           1.46Gi guix-1.4.0-6.dc5430c  52.2MiB 
                   1.70GiB/s 00:00 ▕▎                 ▏   1.7%Backtrace:
In ice-9/boot-9.scm:
   1752:10 19 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           18 (apply-smob/0 #<thunk 7f044ad172a0>)
In ice-9/boot-9.scm:
     724:2 17 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
     619:8 16 (_ #(#(#<directory (guile-user) 7f044ad1cc80>)))
In guix/ui.scm:
    2300:7 15 (run-guix . _)
   2263:10 14 (run-guix-command _ . _)
In ice-9/boot-9.scm:
   1752:10 13 (with-exception-handler _ _ #:unwind? _ # _)
   1752:10 12 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/substitute.scm:
    854:15 11 (_)
     646:2 10 (process-substitution _ _ _ #:cache-urls _ #:acl _ # _ # …)
In ice-9/boot-9.scm:
   1752:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/substitute.scm:
     463:7  8 (download-nar #<<narinfo> path: "/gnu/store/arcljcj925…> …)
In ice-9/boot-9.scm:
   1747:15  7 (with-exception-handler #<procedure 7f0441fd6690 at ic…> …)
   1685:16  6 (raise-exception _ #:continuable? _)
   1683:16  5 (raise-exception _ #:continuable? _)
   1685:16  4 (raise-exception _ #:continuable? _)
   1780:13  3 (_ #<&compound-exception components: (#<&error> #<&irri…>)
   1685:16  2 (raise-exception _ #:continuable? _)
   1683:16  1 (raise-exception _ #:continuable? _)
   1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
ERROR:
   1. &http-get-error:
       uri: #<<uri> scheme: https userinfo: #f host: 
"bordeaux.guix.gnu.org" port: #f path: 
"/nar/zstd/arcljcj925bcsavh66wdfd7ppln66g06-NetworkManager-1.42.6.tar.xz" 
query: #f fragment: #f>
       code: 404
       reason: "Not Found"
       headers: ((server . "nginx") (date . #<date nanosecond: 0 second: 
34 minute: 50 hour: 20 day: 29 month: 5 year: 2023 zone-offset: 0>) 
(content-type text/plain (charset . "utf-8")) (content-length . 3) 
(connection keep-alive))
   2. &message: 
"https://bordeaux.guix.gnu.org/nar/zstd/arcljcj925bcsavh66wdfd7ppln66g06-NetworkManager-1.42.6.tar.xz: 
HTTP-download mislukt: 404 (\"Not Found\")"
aan het downloaden van 
https://ci.guix.gnu.org/nar/lzip/ljajixj3z0pc98lvk4rfr7lydq4mwa16-docbook-xsl-1.79.2-0.fe16c90...

aan het downloaden van 
https://ci.guix.gnu.org/nar/lzip/dr0vdsfch0s2fan6p3kbyalskm8ldk8c-font-abattis-cantarell-0.303-0.e049149-checkout...

substitutie van 
/gnu/store/0bcdfksisqi22p517bf4w44vqlhw4844-alsa-plugins-1.2.2 is klaar
substitutie van 
/gnu/store/ljajixj3z0pc98lvk4rfr7lydq4mwa16-docbook-xsl-1.79.2-0.fe16c90 
is klaar
substitutie van 
/gnu/store/dr0vdsfch0s2fan6p3kbyalskm8ldk8c-font-abattis-cantarell-0.303-0.e049149-checkout 
is klaar
/gnu/store/3y39m6g4ih2l509sygfh21yfpqifaqrp-Blocks.txt vervangen...
/gnu/store/k9yg4n9bhak88xir65j1qd2g8pj4aclc-DerivedAge.txt vervangen...
/gnu/store/068pjh717wzgdai95j7mn98accs1zi7q-LVM2.2.03.11.tar.xz vervangen...
vervanging van 
/gnu/store/arcljcj925bcsavh66wdfd7ppln66g06-NetworkManager-1.42.6.tar.xz 
mislukt
guix system: fout: beschadigde invoer tijdens het terugplaatsen van het 
archief uit #<closed: file 7f8ffe7977e0>

Problems:
   * The server not having a file is not an exceptional situation;
     it should just skip this server or just report that there
     is no available location for this resource instead of
     a backtrace.

   * It claims ‘corrupt input while restoring ...’, but it isn't
     corrupt -- non-existence is not a form of corruption.

   * ‘1.46Gi’ should be ‘1.46GiB’ or ‘1.46GiB/s’ -- Gi is just a prefix,
     it's missing a unit.

In case it matters, I have

           (build-accounts 40)
           (extra-options '("--gc-keep-derivations" "--gc-keep-outputs" 
"--max-jobs=14"))

in the system configuration.

Greetings,
Maxime.