From: Simon Josefsson via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 74949@debbugs.gnu.org
Subject: bug#74949: guix describe crash if HOME is unset OR /etc/passwd is missing
Date: Wed, 18 Dec 2024 18:25:00 +0100 [thread overview]
Message-ID: <87pllokioj.fsf@kaka.sjd.se> (raw)
[-- Attachment #1: Type: text/plain, Size: 3099 bytes --]
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
repository URL: https://git.savannah.gnu.org/git/guix.git
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
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 790c9ffe596e3deabf175e030adee5fb706aa981
sh-5.1#
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]
reply other threads:[~2024-12-18 17:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pllokioj.fsf@kaka.sjd.se \
--to=bug-guix@gnu.org \
--cc=74949@debbugs.gnu.org \
--cc=simon@josefsson.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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).