You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When in sandbox=false in nix.conf or __nochroot=true in builtins.derivation, the derivation is built with a non-existent user rather than nixbld in a normal derivation. This causes programs like podman to fail that require a user.
Steps To Reproduce
Run nix build . For this flake.nix
error: builder for '/nix/store/i94vz5lmpcv95xqi3iai273w9zzb8iah-test.drv' failed with exit code 1;
last 1 log lines:
> whoami: cannot find name for user ID 872415232
For full logs, run 'nix log /nix/store/i94vz5lmpcv95xqi3iai273w9zzb8iah-test.drv'.
Removing __noChroot = true; will not cause this issue, as whoami will return nixbld
Expected behavior
With sandbox=false or __noChroot = true;, a user like nixbld should run the derivation, or the current user running the derivation should be used as the user in the derivation context, or at least setting the user in the derivation should be possible.
nix-env --version output
nix-env (Nix) 2.18.1
Additional context
This causes errors with running any sandbox script with podman, as podman needs to be run by a user in a group. I also cannot switch to a new user in the derivation builder, as su requires a terminal and sudo has been disabled (sudo: The “no new privileges” flag is set, which prevents sudo from running as root.).
I don't have anything to say that will help, but maybe this will be useful information:
This looks like you have the auto-allocate-uids experimental feature enabled. That user ID in your logs is 0x34000000 in hex, and that is the startId which is used for auto-allocate-uids:
That did fix the immediate issue. Thank you. Removing auto-allocate-uids from my configuration.nix makes the user be nixbld1. I still would think a valid user should be used even if auto-allocate-uids is present.
Describe the bug
When in
sandbox=false
innix.conf
or__nochroot=true
inbuiltins.derivation
, the derivation is built with a non-existent user rather thannixbld
in a normal derivation. This causes programs likepodman
to fail that require a user.Steps To Reproduce
Run
nix build .
For thisflake.nix
output:
Removing
__noChroot = true;
will not cause this issue, aswhoami
will returnnixbld
Expected behavior
With
sandbox=false
or__noChroot = true;
, a user likenixbld
should run the derivation, or the current user running the derivation should be used as the user in the derivation context, or at least setting the user in the derivation should be possible.nix-env --version
outputAdditional context
This causes errors with running any sandbox script with
podman
, aspodman
needs to be run by a user in a group. I also cannot switch to a new user in the derivation builder, assu
requires a terminal andsudo
has been disabled (sudo: The “no new privileges” flag is set, which prevents sudo from running as root.
).Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: