guix build: error: integer expected from stream

DoneSubmitted by Tobias Geerinckx-Rice.
Details
3 participants
  • Ludovic Courtès
  • Maxim Cournoyer
  • Tobias Geerinckx-Rice
Owner
unassigned
Severity
important
T
T
Tobias Geerinckx-Rice wrote on 19 Nov 2021 21:47
(address . bug-guix@gnu.org)
87h7c77toj.fsf@nckx
Guix,

I saw this reported by jlicht on #guix but I'm pretty sure that
it's been reported a few times.

Here's the error, with channel:

(channel
(branch "core-updates-frozen")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))

And patch:

Toggle snippet (36 lines)
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 19 Nov 2021 17:37:44 +0100
Subject: [PATCH] daemon: Print the line whence we expect an
integer.

* nix/libstore/local-store.cc
(LocalStore::getLineFromSubstituter):
Include the malformed substituter stream line in the error
message.

---
nix/libstore/local-store.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nix/libstore/local-store.cc
b/nix/libstore/local-store.cc
index 675d1ba66f..83b6681122 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -839,7 +839,8 @@ template<class T> T
LocalStore::getIntLineFromSubstituter(Agent & run)
{
string s = getLineFromSubstituter(run);
T res;
- if (!string2Int(s, res)) throw Error("integer expected from
stream");
+ if (!string2Int(s, res))
+ throw Error(format("integer expected from stream: %1%") %
s);
return res;
}
--
2.34.0

(…which I'd like to merge if there are no objections…)

Toggle snippet (83 lines)
λ guix time-machine -C ~/channels.scm -- build texlive
--substitute-urls="https://guix.tobias.gr
https://bordeaux.guix.gnu.org https://ci.guix.gnu.org"
[…]
substitute: updating substitutes from
'https://guix.tobias.gr'... 100.0%
substitute: updating substitutes from
'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from
'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from
'https://substitutes.nonguix.org'... 100.0%
substitute: updating substitutes from
'https://mirror.brielmaier.net'... 100.0%
The following derivations will be built:
/gnu/store/i32vy0dhw00y59ajpfbzb66z7g5x5bmh-texlive-texmf-20210325.drv
/gnu/store/z5r60zy9vmydf44fdyyc7hgc6q93aahm-texlive-20210325-texmf.tar.xz.drv
100.5 MB will be downloaded:
/gnu/store/0brdikxqk59hdr47qabcm3sya001d8vf-glibc-utf8-locales-2.33
/gnu/store/910a1558wknjm4687681kr0w2invish4-tcsh-6.22.03
/gnu/store/jazwfsj2v41yih2yzw5nydqgdz1hgfm4-file-5.39
/gnu/store/2ank6pw2lrybx24zyifkrc3bkxj8jpf4-lua-5.3.5
/gnu/store/0777brz2w8k5s4g53yfh34fyxp5r08sq-module-import-compiled
/gnu/store/l8kxrs01lll3pzjrd590p45l8k045q6q-make-4.3
/gnu/store/l8l2y2dlya5rs9hfypmcb4saay7iwn0q-findutils-4.8.0
/gnu/store/6mag7gwl47gh7h2lp5byvxxw80x2zi72-ed-1.17
/gnu/store/m96snvbl92ivkd32giqh5f3d21bc2n5x-patch-2.7.6
/gnu/store/s49sxmz9g4xmzz222cay9k04ziy3qgmj-diffutils-3.8
/gnu/store/0v470agxfi4px58491h9932vwliljacr-teckit-2.5.10
/gnu/store/nafmw4krl0q6c1agaz55vz6ls35inw29-zziplib-0.13.72
/gnu/store/dswp2mfwb56xg57903cvhwcjj1fpdhqi-harfbuzz-2.8.2
/gnu/store/fl8vfhmwkg7k1d8qr9apwq5yb0iqa9k5-libpaper-1.1.24
/gnu/store/vbgd375j8p1iprljsizfwkfq56hi6mwi-jbig2dec-0.19
/gnu/store/1d1xbgmdqdsz5pzcmpky3mbgzhxgx7jl-libtiff-4.3.0
/gnu/store/1gn0gbzgqgj8x2vczfr2kgjkw1mlnz14-font-ghostscript-8.11
/gnu/store/hgi1jja24hsj9yjmr6zrpazhgy42v94f-ghostscript-9.54.0
/gnu/store/ic0ria97lvn16kg6jipzqq763rksvmhq-coreutils-minimal-8.32
/gnu/store/k18as85v9s0z66w40wg9sym4c5qz03l2-perl-5.34.0
/gnu/store/vhxayydx3y9n2gi2sc0dam26p7k1aaj8-libjpeg-turbo-2.0.5
/gnu/store/8wzdcc46j1brwgw2kvk5878f887msz6m-gd-2.3.2
/gnu/store/4inr1zm5334vz2p2shznc4iw1478bqan-libxaw-1.0.14
/gnu/store/x64cjzj368falclljlmy72lh5qdk5fdp-mpfr-4.1.0
/gnu/store/izcn0nn61pqf5p0j8073vrq8wyzrmkr4-graphite2-1.3.13
/gnu/store/3nxgh1pmqg44f0ccg16ny4fs81mmafvq-pixman-0.40.0
/gnu/store/53qn4zlhvsmn11lx5s15dqxsnjy59xfc-libxrender-0.9.10
/gnu/store/5ybvb5jxlbfa93znylyy1f68h11l9qla-libelf-0.8.13
/gnu/store/yqsj0ncmzxp4llcj74sj23wl11x3vigw-glib-2.70.0-bin
/gnu/store/qqs98rxwjrji6aaf6dqwp7q4m545g2sn-glib-2.70.0
/gnu/store/2431gxx661891b15zcn5sf14616bh287-cairo-1.16.0
/gnu/store/7cddr79rydhc1m4hxr921mq17pz1jj3z-sed-4.8
/gnu/store/35n3whmk8il5k9mv4i94g3hhq0x5v0iv-config-0.0.0-1.c8ddc84
/gnu/store/72kpdqplq4nc87fm7ch47kxy3nlkzsyx-xz-5.2.5
/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6
/gnu/store/m24fb3ig1wn7yfixp2cvsvik41fv325m-libxmu-1.1.3
/gnu/store/7sik9fp2ffvnr7l01s423x4r5pn75rf9-icu4c-69.1
/gnu/store/45xjw0k3mzpjkxhfhfganl0p8xnqgjq4-libxext-1.3.4
/gnu/store/i67d4yi1zclniycczhi63z4cp42jmqra-libxt-1.2.1
/gnu/store/04ccqq2y4khq38jvianwy9mw6zlr1vf4-libsm-1.2.3
/gnu/store/xb8ksrk21cslvh9pvm53q5qsrhz6613p-libice-1.0.10
/gnu/store/368cv23ggbgl91bw90hyhkqx5dzq0988-libxpm-3.5.13
/gnu/store/ch15pm3i78dvh66l8ds80ijf6kj850j8-libsigsegv-2.13
/gnu/store/v45pjc1yqmy59j9ff913p3ywn9qk4lqx-gawk-5.1.0
/gnu/store/25gv43v5rm05i26z39ajrd6nsxa5r461-coreutils-8.32
/gnu/store/f5jcpy9s4cxzphi0khrqvxhrqnnn9azm-ruby-2.7.4
/gnu/store/375858dr3cqbwry58xcgc0776205p0mf-freetype-2.10.4
/gnu/store/brpl5kly3c64ah2y9v3fgbwl32641c0f-libpng-1.6.37
/gnu/store/q6riv4m9d392dhxdw8jhrn5gsvbcamj9-font-dejavu-2.37
/gnu/store/2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33
/gnu/store/3ywv7s8d38rgcq7ljmc1s084358a2m3h-glibc-2.33-static
/gnu/store/w6zv2mz56wyxr471q38a3cmzm4iqimy8-bzip2-1.0.8
/gnu/store/379xr5pkxprcamhlcbqz9nghj90qxw86-fontconfig-minimal-2.13.94
/gnu/store/irzhgvy2zb6dd9g7a6b343pn4lvsn9n0-texlive-bin-20210325
/gnu/store/35xph93135j3l3l856b2504j1hll53vr-texlive-20210325
substitute: updating substitutes from
'https://guix.tobias.gr'... 100.0%
substitute: updating substitutes from
'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from
'https://ci.guix.gnu.org'... 100.0%
guix build: error: integer expected from stream:
18446744071924943736

So this sounds like integer xerflow, which agains rings a bell…
but I don't remember well enough which one.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYZgO/A0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15BI8BAJY4lWi237PkLuNUwt2WSwPToHBOjUCWRA1oGSU9
hGhBAQCL5arvjyitfv+8jxkAr/wMBKzDNFBB6y4Esbx8pIhjCQ==
=Cwaa
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 19 Nov 2021 22:03
87czmv7t8l.fsf@nckx
Tobias Geerinckx-Rice via Bug reports for GNU Guix 写道:
Toggle quote (5 lines)
> substitute: updating substitutes from
> 'https://ci.guix.gnu.org'... 100.0%
> guix build: error: integer expected from stream:
> 18446744071924943736

And it is indeed specific to querying ci.guix.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYZgROg0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15U30BAKKkeS4IL6JP13x7zlrRkzBmseEFCzGi549d55X1
b1HzAQC+ksqG/BCXPEN3u7erqf+dpBS5rxn3xrfSHyKUX32zAQ==
=B7AK
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 24 Nov 2021 20:52
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 51983@debbugs.gnu.org)
87bl29z5zl.fsf@gmail.com
Hello Tobias!

Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (50 lines)
> Guix,
>
> I saw this reported by jlicht on #guix but I'm pretty sure that
> it's been reported a few times.
>
> Here's the error, with channel:
>
> (channel
> (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git")
> (branch "core-updates-frozen")
> (introduction
> (make-channel-introduction
> "9edb3f66fd807b096b48283debdcddccfea34bad"
> (openpgp-fingerprint
> "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
>
> And patch:
>
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Fri, 19 Nov 2021 17:37:44 +0100
> Subject: [PATCH] daemon: Print the line whence we expect an
> integer.
>
> * nix/libstore/local-store.cc
> (LocalStore::getLineFromSubstituter):
> Include the malformed substituter stream line in the error
> message.
>
> ---
> nix/libstore/local-store.cc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/nix/libstore/local-store.cc
> b/nix/libstore/local-store.cc
> index 675d1ba66f..83b6681122 100644
> --- a/nix/libstore/local-store.cc
> +++ b/nix/libstore/local-store.cc
> @@ -839,7 +839,8 @@ template<class T> T
> LocalStore::getIntLineFromSubstituter(Agent & run)
> {
> string s = getLineFromSubstituter(run);
> T res;
> - if (!string2Int(s, res)) throw Error("integer expected from
> stream");
> + if (!string2Int(s, res))
> + throw Error(format("integer expected from stream: %1%") %
> s);
> return res;
> }

I just stumbled on this.

LGTM!

Maxim
L
L
Ludovic Courtès wrote on 24 Nov 2021 22:59
control message for bug #51983
(address . control@debbugs.gnu.org)
87a6htgqpq.fsf@gnu.org
severity 51983 important
quit
L
L
Ludovic Courtès wrote on 25 Nov 2021 00:24
Re: bug#51983: guix build: error: integer expected from stream
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
877dcxgms7.fsf@gnu.org
Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (8 lines)
> Tobias Geerinckx-Rice via Bug reports for GNU Guix 写道:
>> substitute: updating substitutes from
>> 'https://ci.guix.gnu.org'... 100.0%
>> guix build: error: integer expected from stream:
>> 18446744071924943736
>
> And it is indeed specific to querying ci.guix.

This reminds me of:


and indeed:

Toggle snippet (12 lines)
$ guix build flightgear -n --no-grafts
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bayfront.guix.gnu.org'... 100.0%
guix build: error: integer expected from stream
$ guix describe
Generacio 195 Nov 22 2021 00:37:58 (nuna)
guix 24aa7b3
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6

The ‘NarSize’ field is still broken on ci.guix:

Toggle snippet (10 lines)
$ wget -qO - https://ci.guix.gnu.org/ashmi6vr9d0k03z9q6ncbb2wf36p9nyk.narinfo |grep Size
FileSize: 1876560180
FileSize: 1715771086
FileSize: 1753645085
NarSize: 18446744072093825552
$ wget -qO - https://bordeaux.guix.gnu.org/ashmi6vr9d0k03z9q6ncbb2wf36p9nyk.narinfo |grep Size
FileSize: 1715771086
NarSize: 2679241232

and again the database on berlin has a negative size:

Toggle snippet (7 lines)
$ sudo sqlite3 /var/guix/db/db.sqlite
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
sqlite> select * from validpaths where path = '/gnu/store/ashmi6vr9d0k03z9q6ncbb2wf36p9nyk-flightgear-2020.3.11';
56551239|/gnu/store/ashmi6vr9d0k03z9q6ncbb2wf36p9nyk-flightgear-2020.3.11|sha256:1c68105efd8ee4677085a2cecaa5859f1f5f213d52e213ef4949384717dc493a|1636968959|/gnu/store/xvyar43mcfw0r7jfm1x0a2i9rhnsdh87-flightgear-2020.3.11.drv|-1615726064

[Time passes…]

OK, this one is now fixed by commit
1eb40a6dc4917f5a2e915f8b31b750dba3d378c6m, which means you now get:

Toggle snippet (6 lines)
$ guix build flightgear --no-grafts -n
1,715.8 MB would be downloaded:
/gnu/store/ashmi6vr9d0k03z9q6ncbb2wf36p9nyk-flightgear-2020.3.11
guix build: warning: at least 18,446,744,072,093.8 MB needed but only 4,753.4 MB available in /gnu/store

Fun, no? :-)

Also, after substitution, the size in the store database would be the
wrong one, so ‘guix size’ would keep telling you it’s this big. Not
great but harmless as the nar size is used for UI purposes only.

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 51983@debbugs.gnu.org