Open peterzandbergen opened 3 weeks ago
@peterzandbergen thanks for adding this to an issue. As you mentioned in Discord, this is most likely due to Devbox being compiled with cgo disabled. From the os/user
docs:
For most Unix systems, this package has two internal implementations of resolving user and group ids to names, and listing supplementary group IDs. One is written in pure Go and parses /etc/passwd and /etc/group. The other is cgo-based and relies on the standard C library (libc) routines such as getpwuid_r, getgrnam_r, and getgrouplist.
When cgo is available, and the required routines are implemented in libc for a particular platform, cgo-based (libc-backed) code is used. This can be overridden by using osusergo build tag, which enforces the pure Go implementation.
I'd rather not enable cgo, so we should track down why we need the current user and see if there's a way to degrade gracefully.
I double checked, and I can't find anywhere that devbox or its dependencies prints this error. All of our calls to the os/user
package have annotated errors. I also don't see "cannot find name for group ID" in the Go stdlib source.
This might be from some other program that's running as part of an init hook, plugin, or shell rcfile.
@peterzandbergen I saw your comment about adding more info. I'll wait until we have the devbox.json and DEVBOX_DEBUG=1
logs before digging further.
Here are devbox.json and the output of devbox shell with DEVBOX_DEBUG=1
Taken from the terminal
Looking at the last log I thought that this file might be useful. It is the file that is mentioned at line 36 in the previous log file I sent.
I ran the bash with -x and the rc file and this is the begin of the output where the error messages are written
It looks like groups is the culprit
See the difference between the nix and non nix version.
What happened?
When I run
devbox shell
in an initialized directory, the output shows a list of groups for which it cannot find the names of the group. The shell starts successfully.I looked at the code and it seems to me that the error is somewhere in config.go.
I can sort of simulate the same error with the program that I included.
NOTE: I will add the required info later.
Steps to reproduce
You need a Linux machine, mine is Ubuntu, that uses LDAP for authentication and authorization, and be logged in as a user from the LDAP. This results in not having the user in the /etc/passwd file and not having the group memberships in /etc/groups
devbox-group-bug.tar.gz output.zip
Command
No response
devbox.json
Devbox version
0.11.0
Nix version
2.22.1
What system does this bug occur on?
Linux (x86-64)
Debug logs
No response