[Nix-dev] unable to delete a store path

Shea Levy shea at shealevy.com
Wed Sep 26 13:55:26 CEST 2012


On 09/26/2012 07:49 AM, Mathijs Kwik wrote:
> On Wed, Sep 26, 2012 at 1:39 PM, Marc Weber<marco-oweber at gmx.de>  wrote:
>> Try such:
>>
>>    STORE_PATH=/nix/store/jra1icncr6bfp9ysjf858z9rs3r54h4
>>
>>    follow_link_rec(){
>>      if [ -s "$1" ]; then
>>        [ /nix/store == "${1:0:10}" ]&&  echo "$1"
>>        follow_link_rec "$(readlink "$1")"
>>      else
>>        echo "$1"
>>      fi
>>    }
>>
>>    find /nix/var/nix/gcroots -type l | while read l; do
>>      if follow_link_rec "$l" | grep  -q $STORE_PATH; then
>>        echo "$l" somehow references your store path $STORE_PATH
>>      fi
>>    done
>>
>> In my test (using the store path referenced by /var/run/current-system)
>> I get this output:
>>
>>    /nix/var/nix/gcroots/current-system somehow references your store path /nix/store/jra1icncr6bfp9ysjf858z9rs3r54h4
>>    /nix/var/nix/gcroots/booted-system somehow references your store path /nix/store/jra1icncr6bfp9ysjf858z9rs3r54h4
> I get no output when I run your script against my store path
>
>> and this is expected. However mind that the nix-store query you ran does
>> not show the gc root origin:
>>
>> %nix-store --query --referrers-closure  /nix/store/jra1icncr6bfp9ysjf858z9rs3r54h4l-nixos-0.1pre-git
>> /nix/store/jra1icncr6bfp9ysjf858z9rs3r54h4l-nixos-0.1pre-git
> I checked the gc roots too, see my previous mail
>
>> However like in your case it seems to reference itself (whatever this
>> means - don't know)
> It seems a lot of store paths refer to themselves, so I don't think
> that's the cause of the problem.
>
>> So what may have happened? Eventually you ran nix-build or such
>> (creating a result link) in /nix/var/nix/gcroots ?
>> Is this allowed? That's just a wild guess.
> I really have no idea. I've never built xine myself, as I don't use
> it. It must have come as a dependency for kde or something but I'm
> 100% sure I've never ran nix-build or nix-env for it directly.
>
>> If you get some output we'll know more, if you don't we'll have to
>> continue digging for the cause.
> Well it's not that big an issue. I think in this case it's pretty safe
> to manually delete it, but it would be nice to find out what happened.

If you do give up, before manually deleting it try nix-store --delete 
--ignore-liveness. That bypasses gcroots but fails if there's another 
path in the path's referrers (so it shouldn't fail in your case, but it 
might since this seems like a bug).

>> Marc Weber
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list