Subject: bug#78126: "guix refresh --list-updaters" fails with json-invalid

From: Ricardo Wurmus <[email-masked]>
Date: Tue, 29 Apr 2025 09:53:07 +0200

"guix refresh --list-updaters" prints information for a few 
updaters and then crashes:

--8<---------------cut here---------------start------------->8---
Available updaters:

  - bioconductor: Updater for Bioconductor packages (2.2% 
  coverage)
  - composer: Updater for Composer packages (.0% coverage)
  - cpan: Updater for CPAN packages (2.7% coverage)
  - cran: Updater for CRAN packages (5.7% coverage)
  - crate: Updater for crates.io packages (17.0% coverage)
  - egg: Updater for CHICKEN egg packages (.0% coverage)
  - elpa: Updater for ELPA packages (.4% coverage)
  - gem: Updater for RubyGem packages (1.2% coverage)
  - github: Updater for GitHub packages (31.0% coverage)
  - gnome: Updater for GNOME packages (.8% coverage)
  - gnu: Updater for GNU packages (.9% coverage)
  - gnu-ftp: Updater for GNU packages only available via FTP (.4% 
  coverage)
  - hackage: Updater for Hackage packages (2.4% coverage)
  - hexpm: Updater for hex.pm packages (.2% coverage)
  - kde: Updater for KDE packages (1.1% coverage)
  - kernel.org: Updater for packages hosted on kernel.org (.1% 
  coverage)
  - launchpad: Updater for Launchpad packages (.0% coverage)
  - minetest: Updater for Minetest packages on ContentDB (.1% 
  coverage)
  - opam: Updater for OPAM packages (.9% coverage)
  - pypi: Updater for PyPI packages (7.4% coverage)
  - savannah: Updater for packages hosted on savannah.gnu.org (.2% 
  coverage)
  - sourceforge: Updater for packages hosted on sourceforge.net 
  (1.3% coverage)
Backtrace:
In guix/scripts/refresh.scm:
   348:29 19 (_ #<<upstream-updater> name: stackage description: 
   "Updater for Stackage LTS packages" pred: #<procedure 
   stackage-lts-package? (package)> import: #<procedure 7…> …)
In unknown file:
          18 (filter #<procedure stackage-lts-package? (package)> 
          (#<package [email-masked] gnu/packages/zwave.scm:37 
          7f4a5e9a16e0> #<package [email-masked] g…> 
          …))
In guix/import/utils.scm:
    134:4 17 (call-with-networking-exception-handler _)
In ice-9/boot-9.scm:
  1752:10 16 (with-exception-handler _ _ #:unwind? _ 
  #:unwind-for-type _)
In guix/import/stackage.scm:
   176:25 15 (_)
In guix/memoization.scm:
     98:0 14 (mproc "20.26")
In unknown file:
          13 (_ #<procedure 7f4a5de65000 at 
          guix/memoization.scm:179:32 ()> #<procedure list _> 
          (this is nothing))
In guix/import/stackage.scm:
    86:30 12 (_ _)
In ice-9/exceptions.scm:
   406:15 11 (json-fetch _ #:http-fetch _ #:timeout _ #:headers _)
In ice-9/boot-9.scm:
  1752:10 10 (with-exception-handler _ _ #:unwind? _ 
  #:unwind-for-type _)
In guix/import/json.scm:
    55:19  9 (_)
In json/parser.scm:
   404:20  8 (json->scm _ #:null _ #:ordered _ #:concatenated _)
   227:20  7 (json-read-object #<input: string 7f4a6410e070> null 
   #f)
   209:18  6 (read-pair #<input: string 7f4a6410e070> null #f)
   261:22  5 (json-read-array #<input: string 7f4a6410e070> null 
   #f)
   227:20  4 (json-read-object #<input: string 7f4a6410e070> null 
   #f)
   209:18  3 (read-pair #<input: string 7f4a6410e070> null #f)
     40:2  2 (json-read-string #<input: string 7f4a6410e070>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Throw to key `json-invalid' with args `(#<input: string 
7f4a6410e070>)'.
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo