Skip to content

"error: getting sandbox mount namespace: No such file or directory" on some commands #8072

Closed
@NobbZ

Description

Describe the bug

I have not yet found out why exactly this happens and under which circumstances.

But nixos-rebuild as well as home-manager switch fail eventually with either staling or the error mentioned in the subject.

With nixos-rebuild switch this happened early and without much other messages, while with HM it happens during activation:

$ # Here I tried to get my current config but with a generally known to work nix, to rule
$ # out problems with the demon, I eventually rolled back to a good configuration.
$ sudo nixos-rebuild switch --flake github:nobbz/nixos-config --override-input nix github:nixos/nix/2.14.0
warning: not writing modified lock file of flake 'github:nobbz/nixos-config':
• Updated input 'nix':
    'github:nixos/nix/b5b6055bbf00fa809633e88dab1e8eaec3ae9f8d' (2023-03-18)
  → 'github:nixos/nix/4b156ad944bd776eeeba4b7394781ac02c68d7a4' (2023-02-28)
• Removed input 'nix/flake-compat'
[0/1 built, 1.2 MiB DL]
error: getting sandbox mount namespace: No such file or directory
$ home-manager switch --flake github:nobbz/nixos-config                                                                                                                                                                                                                                                 
Starting Home Manager activation                                                                                                                                                                                                                                              
Activating checkFilesChanged                                                                                                                                                                                                                                                  
Activating checkLinkTargets                                                                                                                                                                                                                                                   
Activating writeBoundary                                                                                                                                                                                                                                                      
Activating installPackages                                                                                                                                                                                                                                                    
replacing old 'home-manager-path'                                                                                                                                                                                                                                             
installing 'home-manager-path'                                                                                                                                                                                                                                                
error: getting sandbox mount namespace: No such file or directory                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                              
Oops, Nix failed to install your new Home Manager profile!                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                              
Perhaps there is a conflict with a package that was installed using                                                                                                                                                                                                           
"nix-env -i"? Try running                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                              
    nix-env -q                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                              
and if there is a conflicting package you can remove it with                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                              
    nix-env -e {package name}                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                              
Then try activating your Home Manager configuration again.

Steps To Reproduce

  1. Use nix from b5b6055
  2. try to switch the configuration as above. I had the error randomly appearing on build and shell as well
  3. see error

Expected behavior

No error and no staling build

nix-env --version output

$ # bad
$ nix --version
nix (Nix) 2.15.0pre20230318_b5b6055
$ # good
$ nix --version
nix (Nix) 2.15.0pre20230315_eb56cb7

Additional context

Not yet bisected. Especially as I am not quite sure if this is a single problem with multiple symptoms or 2 or more individual problems (stale and error)

edit: (A forced build seems to trigger at least one instance of the error and I start bisecting that now under the assumption that 30 second "stale" are the same as the error message from subject)

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions