DavHau / nix-portable

Nix - Static, Permissionless, Installation-free, Pre-configured
MIT License
788 stars 29 forks source link

Error when trying to `nix-store --gc` #25

Open ShamrockLee opened 2 years ago

ShamrockLee commented 2 years ago
$ nix-portable nix-shell --gc`, an error
finding garbage collector roots...
0 store paths deleted, 0.00 MiB freed
reading symlink: Operation not permitted
error: --- SysError -------------- nix-store
reading symlink: Operation not permitted

The same error occurs when running directly or inside a nix-shell environment.

When entering an arbitrary nix-shell (e.g. by nix-portable nix-shell -p git), readlink works alright on the result links and all the symlinks under /nix/var/nix/gcroots/auto (/nix/var/nix/gcroots/per-user/myuser is empty). However, when trying

$ readlink /nix/var/nix/gcroots/profiles

$ echo $?
1

while ls -l /nix/var/nix/gcroots shows that /nix/var/nix/gcroots/profiles is a bolic link to /nix/var/nix/profiles.

Platform: CentOS 7 (CERN LXPLUS)

alecandido commented 8 months ago

I guess there has been some confusion in the OP, since the title is about nix-store but the command is nix-shell (maybe I'm missing something, but nix-shell doesn't have any --gc option).

I actually tried with nix-store, and here instead is the error message:

[user@host]~% nix-portable nix-store --gc
0 store paths deleted, 0.00 MiB freed
error: cannot bind to socket '/nix/var/nix/gc-socket/socket': Operation not permitted

Notice that there is no /nix folder at all (NP_LOCATION is also set to another folder, but otherwise the only instance would be anyhow in my home).

Same issue with the new-style command nix store gc.