extra-sandbox-paths doesn't work on multi-user install #6115
Copy link
Copy link
Closed
Labels
Description
Activity
I'd appreciate if someone took a look at this. It makes upgrading to Nix newer than
2.3.16impossible.It may be because you're not a trusted user? If you run with
-vvv, it will show a warning about ignored client settings:# nix-build ./sandbox-test.nix --extra-sandbox-paths /tmp/sandbox-file -vvv 2>&1 | grep trusted ignoring the client-specified setting 'sandbox-paths', because it is a restricted setting and you are not a trusted userOh wow, you're right!
> nix-build --extra-sandbox-paths /tmp/sandbox-file -vvv 2>&1 | grep trusted ignoring the client-specified setting 'sandbox-paths', because it is a restricted setting and you are not a trusted userAfter adding
trusted-users = jenkinsto/etc/nix/nix.confit works!> cat $(nix-build --extra-sandbox-paths /tmp/sandbox-file) TESTThanks @edolstra this definitely solves the issue for me.
Although honestly, I'm not sure why this kind of important warning/error should be hidden behind tripple
-vflag.Yeah, it used to be a warning rather than a debug message, but then people got spammed a lot about irrelevant client-side settings not being allowed by the daemon. We should improve that...
Reacted by Jakub
Describe the bug
We are using the
extra-sandbox-pathsoption withnix-buildin order to provide secrets to our mobile builds, android keystore for example. I'm trying to upgarde to2.6.0, but this functionality appears to not work, and files provided via--option extra-sandbox-pathsare not available in the build sandbox.Steps To Reproduce
extra-sandbox-paths:nix-build --option extra-sandbox-paths '/tmp/sandbox-fileExpected behavior
I expected it to work, like it does in a single-user installation or on NixOS.
Additional context
I have
straced thenix-daemonprocess and found out that it gets anENOENTerror:But the file exists, and had the right permissions so a
nixbld*user can read it:So I don't know what the issue is. Especially since it works fine on NixOS.