-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems deleting store paths #7488
Comments
I had a lot of trouble deleting store paths today so I just thought I'd add my voice to this issue. The issue has been fixed now thanks to the amazing advice of @tpwrules, so I can't give exact error messages, but I'll try to relate what happened as accurately as possible. In my case, I tried running
Then I tried this:
Now most of the time when I ran I tried doing the @tpwrules xargs trick above and it initially didn't work. Then I rebooted and it finally worked, fully deleting the problematic derivation. The final command I ran which worked was:
I did see nix store repair but I don't think I tried it because it didn't seem like it really applies to derivations. It seems to me like there are no good tools available for repairing the Nix store. The path |
This is still a problem. I build this (for testing)
Running
give no result, however this happens
|
Describe the bug
nix-store --delete /nix/store/<blah>
fails, claiming that the path is still alive due to a GC root. However, runningnix-store -q --roots /nix/store/<blah>
as suggested by Nix shows no GC roots.The path can be properly deleted using a command such as
nix-store -q --referrers-closure /nix/store/<blah> | xargs nix-store --delete
Steps To Reproduce
Expected behavior
I expect Nix to not send me on a chase for a GC root which does not exist, and either delete the path and its referrers, or be more clear with the reason the path was not deleted and how to diagnose the problem.
nix-env --version
outputnix-env (Nix) 2.12.0
Additional context
This is really a place to centralize the discussion around this issue and provide a workaround as it is a continual problem for me and the community. Other instances of this issue include #7160, #6141 .
This used to work properly in Nix 2.4 and before, but the behavior was changed. The former behavior was somewhat dangerous, but at least it worked. Perhaps it can be reintroduced under a
--force
flag. In any case the message needs to be fixed, ideally with the names of the paths preventing deletion or the correct command (nix-store --query --referrers-closure
) to list them.There is a similar issue (includes explanation and workaround) triggered by involving
sudo
. There is also a proposal to delete (as much as possible of) a closure of a specific path, which is in some sense the opposite of the request here (and the reason--recursive
was not suggested as the name of the flag above).There might be a different bug where even the workaround above is not sufficient: #6354 (comment), #6141 (comment) . I could not reproduce these problems myself. If the workaround here does not work for you, please get in touch on Matrix and, if possible, note down the affected store path and create some sort of system snapshot for experimentation.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: