Skip to content

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

Open

Description

@nh2

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

Activity

  1. 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
  2. self-assigned this
    on Apr 1, 2018
  3. picnoir commented on Apr 5, 2018

    @picnoir
    Member

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

  4. added 2 commits that reference this issue on Apr 5, 2018
    01158cf
    0ff6330
  5. added
    UX
    and removed on Apr 6, 2018
  6. added 2 commits that reference this issue on Apr 6, 2018
    75ed4a0
    a0b3a67
  7. bobvanderlinden commented on May 22, 2018

    @bobvanderlinden
    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?

  8. picnoir commented on May 25, 2018

    @picnoir
    Member

    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.

  9. 2 remaining items

  10. jakubgs commented on Feb 20, 2021

    @jakubgs

    Still quite relevant.

  11. pikajude commented on Mar 4, 2021

    @pikajude
    Contributor

    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.

  12. added a commit that references this issue on May 25, 2021
    37e1467
  13. orivej commented on May 25, 2021

    @orivej
    Contributor

    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)

  14. stale commented on Nov 25, 2021

    @stale

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

  15. jakubgs commented on Nov 26, 2021

    @jakubgs

    This is still quite relevant.

  16. stale commented on Jul 11, 2022

    @stale

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

  17. jakubgs commented on Jul 11, 2022

    @jakubgs

    Bot, please...

  18. added
    error-messages
    and removed on Sep 13, 2022
  19. Et7f3 commented on Feb 21, 2023

    @Et7f3
    Contributor

    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

Metadata

Metadata

Assignees

Labels

UXerror-messages

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions