Skip to content
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

Tell user why a given path is live when it can't be deleted (continued from #171) #1810

Open
nh2 opened this issue Jan 20, 2018 · 13 comments · May be fixed by #4850
Open

Tell user why a given path is live when it can't be deleted (continued from #171) #1810

nh2 opened this issue Jan 20, 2018 · 13 comments · May be fixed by #4850
Assignees
Labels
error-messages Confusing messages and better diagnostics UX The way in which users interact with Nix. Higher level than UI.

Comments

@nh2
Copy link
Contributor

nh2 commented Jan 20, 2018

Continuation of #171 (due to #171 (comment)).

CC subscribers from over there: @shlevy @jb55 @qknight @nh2 @edolstra

Original problem:


$ 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

And

$ nix-store -q --roots  /nix/store/ixmvap0270115iwkz6fljjccghvnf928-nixos-13.10pre34775.a63b4dc
/nix/var/nix/profiles/system-53-link`

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
@nh2 nh2 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) Jan 20, 2018
@shlevy shlevy added the backlog label Apr 1, 2018
@shlevy shlevy self-assigned this Apr 1, 2018
@picnoir
Copy link
Member

picnoir commented 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 :)

picnoir added a commit to picnoir/nix that referenced this issue Apr 5, 2018
Add the name of the closest link to a garbage root when
a path cannot be removed from nix-store.

Fix NixOS#1810.
picnoir added a commit to picnoir/nix that referenced this issue Apr 5, 2018
Add the name of the closest link to a garbage root when
a path cannot be removed from nix-store.

Fix NixOS#1810.
@shlevy shlevy added improvement UX The way in which users interact with Nix. Higher level than UI. and removed backlog labels Apr 6, 2018
picnoir added a commit to picnoir/nix that referenced this issue Apr 6, 2018
picnoir added a commit to picnoir/nix that referenced this issue Apr 6, 2018
Add the name of the closest link to a garbage root when
a path cannot be removed from nix-store.

Fix NixOS#1810.
@bobvanderlinden
Copy link
Member

@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
Copy link
Member

picnoir commented 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.

@fmnxl
Copy link

fmnxl commented Aug 24, 2020

For me it was because it was still used by direnv (with use nix), and I imported the package in my shell.nix. I forget sometimes that direnv is on the background.

Just sharing my finding. Hope it helps someone.

@stale
Copy link

stale bot commented Feb 20, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 20, 2021
@jakubgs
Copy link

jakubgs commented Feb 20, 2021

Still quite relevant.

@stale stale bot removed the stale label Feb 20, 2021
@pikajude
Copy link
Contributor

pikajude commented Mar 4, 2021

For people coming here from a Google search, check whether you have

keep-derivations = true
keep-outputs = true

in your nix.conf, because those options will also keep alive store paths that you expect to be deleted.

orivej added a commit to orivej/nix that referenced this issue May 25, 2021
@orivej orivej linked a pull request May 25, 2021 that will close this issue
@orivej
Copy link
Contributor

orivej commented May 25, 2021

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)

@stale
Copy link

stale bot commented Nov 25, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Nov 25, 2021
@jakubgs
Copy link

jakubgs commented Nov 26, 2021

This is still quite relevant.

@stale stale bot removed the stale label Nov 26, 2021
@stale
Copy link

stale bot commented Jul 11, 2022

I marked this as stale due to inactivity. → More info

@jakubgs
Copy link

jakubgs commented Jul 11, 2022

Bot, please...

@fricklerhandwerk fricklerhandwerk added error-messages Confusing messages and better diagnostics and removed improvement labels Sep 13, 2022
@Et7f3
Copy link
Contributor

Et7f3 commented Feb 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Confusing messages and better diagnostics UX The way in which users interact with Nix. Higher level than UI.
Projects
None yet