guix describe crash if HOME is unset OR /etc/passwd is missing

  • Open
  • quality assurance status badge
Details
One participant
  • Simon Josefsson
Owner
unassigned
Submitted by
Simon Josefsson
Severity
normal
S
S
Simon Josefsson wrote on 18 Dec 2024 18:25
(address . bug-guix@gnu.org)
87pllokioj.fsf@kaka.sjd.se
Hi

I get the backtrace below. Setting either HOME to something, or adding
an entry to /etc/passwd for the running user, silences this.

I don't think it should fail like this, should it?

Is a reasonable behaviour to assume HOME means "/" when unset?

How to handle missing /etc/passwd entries probably depends on what the
code wants to use it for.

/Simon

jas@kaka:~/src/guix-container$ podman run --entrypoint /bin/sh -it registry.gitlab.com/debdistutils/guix/container:latest
sh-5.1# guix describe
Backtrace:
In ice-9/boot-9.scm:
222:29 19 (map1 _)
222:29 18 (map1 _)
222:29 17 (map1 _)
222:29 16 (map1 _)
222:29 15 (map1 _)
222:29 14 (map1 _)
222:29 13 (map1 _)
222:29 12 (map1 (((guix packages)) ((guix profiles)) ((guix #)) ?))
222:17 11 (map1 (((guix profiles)) ((guix derivations)) ((# #)) ?))
3327:17 10 (resolve-interface (guix profiles) #:select _ #:hide _ # ?)
In ice-9/threads.scm:
390:8 9 (_ _)
In ice-9/boot-9.scm:
3253:13 8 (_)
In ice-9/threads.scm:
390:8 7 (_ _)
In ice-9/boot-9.scm:
3544:20 6 (_)
2836:4 5 (save-module-excursion #<procedure 7fe582a23b10 at ice-?>)
3564:26 4 (_)
In unknown file:
3 (primitive-load-path "guix/profiles" #<procedure 7fe582?>)
In guix/profiles.scm:
2388:23 2 (_)
In guix/utils.scm:
1071:48 1 (xdg-directory _ "/.config" #:ensure? _)
In unknown file:
0 (getpw 0)

ERROR: In procedure getpw:
In procedure getpw: entry not found
sh-5.1# export HOME=/
sh-5.1# guix describe
guix 790c9ff
branch: master
commit: 790c9ffe596e3deabf175e030adee5fb706aa981
sh-5.1# exit
jas@kaka:~/src/guix-container$ podman run --entrypoint /bin/sh -it registry.gitlab.com/debdistutils/guix/container:latest
sh-5.1# guix describe
Backtrace:
In ice-9/boot-9.scm:
222:29 19 (map1 _)
222:29 18 (map1 _)
222:29 17 (map1 _)
222:29 16 (map1 _)
222:29 15 (map1 _)
222:29 14 (map1 _)
222:29 13 (map1 _)
222:29 12 (map1 (((guix packages)) ((guix profiles)) ((guix #)) ?))
222:17 11 (map1 (((guix profiles)) ((guix derivations)) ((# #)) ?))
3327:17 10 (resolve-interface (guix profiles) #:select _ #:hide _ # ?)
In ice-9/threads.scm:
390:8 9 (_ _)
In ice-9/boot-9.scm:
3253:13 8 (_)
In ice-9/threads.scm:
390:8 7 (_ _)
In ice-9/boot-9.scm:
3544:20 6 (_)
2836:4 5 (save-module-excursion #<procedure 7fac35694b10 at ice-?>)
3564:26 4 (_)
In unknown file:
3 (primitive-load-path "guix/profiles" #<procedure 7fac35?>)
In guix/profiles.scm:
2388:23 2 (_)
In guix/utils.scm:
1071:48 1 (xdg-directory _ "/.config" #:ensure? _)
In unknown file:
0 (getpw 0)

ERROR: In procedure getpw:
In procedure getpw: entry not found
sh-5.1# echo 'root:x:0:0:root:/root:/bin/bash' > /etc/passwd
sh-5.1# guix describe
guix 790c9ff
branch: master
commit: 790c9ffe596e3deabf175e030adee5fb706aa981
sh-5.1#
-----BEGIN PGP SIGNATURE-----

iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCZ2MFbBQcc2ltb25Aam9z
ZWZzc29uLm9yZwAKCRBRcisI/kdFoic9AP0Z7iO3HtsuJPRH4v3xjYWiBj3v98Qq
TxoGeIAa57A16QEA64OY+7LWlvA4JXryX0VPu239KnreeEUbTW0RWzSU6gc=
=yOvL
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 74949
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch