You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tell user why a given path is live when it can't be deleted (continued from #171) #1810
$ nix-store --delete /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
finding garbage collector roots...
error: cannot delete path `/nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc' since it is still alive
0 store paths deleted, 0.00 MiB freed
Would be nice if instead the first command output:
$ nix-store --delete /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
finding garbage collector roots...
error: cannot delete path `/nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc' since it is still alive (reachable from /nix/var/nix/profiles/system-53-link)
0 store paths deleted, 0.00 MiB freed
Reacted by Will Dietz, Linus Heckemann, Matthieu Coudron, angerman, gabby, Ashijit Pramanik, Milán Nagy, Dennis Gosnell, Leo Nikkilä, Pamplemousse and 16 more
changed the title [-]Tell user why a given path is live when it can't be deleted (continued)[/-][+]Tell user why a given path is live when it can't be deleted (continued from #171)[/+]on Jan 20, 2018
@NinjaTrappeur looks like you already got steps in the right direction. What is the current status? Did you run into a problem? Can I help get this merged into Nix?
I was investigating why I had so many obsolete versions of Perl in /nix/store (while nix-store -q kept telling me that they are needed for the current system, but not for anything in /nix/store) and made this fix: #4850
My issue turned out to be that with keep-outputs = true (and with keep-derivations being true by default) programs (in particular curl with its dependencies, including perl) that were once used to realize a still needed fixed output derivation were kept forever (because keep-derivations keeps the old fixed output .drv, which mentions specific old versions of tools to make that .drv, and with keep-outputs the old tools themselves are kept)
nix-store --referrers does show why it is lives. So quick fix is to add this in messages. We can't use --roots and --referrers at the same time which is annoying.
Activity
[-]Tell user why a given path is live when it can't be deleted (continued)[/-][+]Tell user why a given path is live when it can't be deleted (continued from #171)[/+]picnoir commentedon Apr 5, 2018
Hello,
I am looking for an excuse to dive in the nix-store garbage collector code. I'm fixing this one if it's ok with @shlevy :)
Explain why a given nix path cannot be deleted.
Explain why a given nix path cannot be deleted.
nix-store collectGarbage: Ensure GCrootLink exists
nix-store: Explain why nix path cannot be deleted.
bobvanderlinden commentedon May 22, 2018
@NinjaTrappeur looks like you already got steps in the right direction. What is the current status? Did you run into a problem? Can I help get this merged into Nix?
picnoir commentedon May 25, 2018
Hey @bobvanderlinden ,
So, I made a UI proposal there, and tested it a bit in order to spot obvious regressions.
I am waiting for some feedback. Both for the feature by itself as well as for the code.
2 remaining items
jakubgs commentedon Feb 20, 2021
Still quite relevant.
pikajude commentedon Mar 4, 2021
For people coming here from a Google search, check whether you have
in your
nix.conf, because those options will also keep alive store paths that you expect to be deleted.Make nix-store --delete explain why a path is alive
orivej commentedon May 25, 2021
I was investigating why I had so many obsolete versions of Perl in /nix/store (while
nix-store -qkept telling me that they are needed for the current system, but not for anything in /nix/store) and made this fix: #4850My issue turned out to be that with
keep-outputs = true(and with keep-derivations being true by default) programs (in particular curl with its dependencies, including perl) that were once used to realize a still needed fixed output derivation were kept forever (because keep-derivations keeps the old fixed output .drv, which mentions specific old versions of tools to make that .drv, and with keep-outputs the old tools themselves are kept)stale commentedon Nov 25, 2021
I marked this as stale due to inactivity. → More info
jakubgs commentedon Nov 26, 2021
This is still quite relevant.
stale commentedon Jul 11, 2022
I marked this as stale due to inactivity. → More info
jakubgs commentedon Jul 11, 2022
Bot, please...
Et7f3 commentedon Feb 21, 2023
nix-store --referrersdoes show why it is lives. So quick fix is to add this in messages. We can't use--rootsand--referrersat the same time which is annoying.