Upgraded to Nix 2.14.1 and profiles are not being created

Not sure if this is a change in Nix itself or we are doing something wrong, but since we’ve upgraded to 2.14 developers have been experiencing errors like these:

error: creating directory '/nix/var/nix/gcroots/per-user/siddarthkumar': Permission denied
error: creating directory '/nix/var/nix/gcroots/gcroots/siddarthkumar': Permission denied

Obviously the solution to this is to create those folders with correct permissions, but this seems like a regression to me. It seems to be that on Nix 2.11 we used before these folders would be created by Nix when the first package was installed in the profile.

Either I’m missing something very obvious, or this is a regression in recent Nix.

2 Likes

I have tested this with Nix 2.14.1 and it fails:

jakubgs@ubuntuvm:~/status-mobile$ nix-instantiate --attr shells.default --add-root /nix/var/nix/gcroots/per-user/${USER}/status-mobile default.nix 
error: creating directory '/nix/var/nix/gcroots/per-user/jakubgs': Permission denied

But if I downgrade to 2.13.4 it works fine:

jakubgs@ubuntuvm:~/status-mobile$ nix-instantiate --attr shells.default --add-root /nix/var/nix/gcroots/per-user/${USER}/status-mobile default.nix 
/nix/var/nix/gcroots/per-user/jakubgs/status-mobile
2 Likes

This is a known problem with 2.14 and 2.15. The issues should be fixed with 2.16.

Please either do update to the latest release or downgrade to 2.13.

1 Like

I have tried 2.16.1 and tried using nix--instantiate but it fails the same way:

jakubgs@ubuntuvm:~/status-mobile % nix-instantiate --attr shells.default --add-root /nix/var/nix/gcroots/per-user/${USER}/status-mobile/shells.default default.nix
error: creating directory '/nix/var/nix/gcroots/per-user/jakubgs': Permission denied

jakubgs@ubuntuvm:~/status-mobile % nix-instantiate --version
nix-instantiate (Nix) 2.16.1

So it doesn’t look to me like 2.16 fixes the issue.

I see, this is probably a so far undiscovered side effect of the same base issue.

And it seems as if you already posted a bug because of this.

I found it when I wanted to check for the old issues with similar symptoms. As only now I see that you have a problem with GCroots, and not profiles…