Open teto opened 1 month ago
garbage-collecting everything unblocked me but this doesn't seem like a good workaround. I'll leave this open in case the maintainers want to requalify the UX problems (more actionable messages: why can't nix repair the pat ? when --check ing, mention how to --repair etc) I mentioned but feel free to close otherwise.
.drv
files are often not pushed to a cache, in which case the only way to restore them is to perform instantiation again, ie evaluate.
Currently these files are not checked; the instantiation process assumes that "valid" (ie extant) store paths are not corrupted.
That's a choice that was made for performance, but with an extra bit in the database, we could get both performance and automatic recovery.
TODO:
sudo
in
nix store repair --all
error: operation 'repairPath' is not supported by store 'daemon'`
cannot repair path
-> say it wasn't substitutable
Describe the bug
I find myself in a situation where I can't rebuild my system and I am not sure how to repair the store without manually deleting lots of derivations.
Upon nixos-rebuild, I've got an error I've never seen before:
error: error parsing derivation '/nix/store/8ihsdsn00n2p9hy9hz2jmw5z5wfl3w9r-nss-3.102.drv': error: expected string 'D'.
When I look at /nix/store/8ihsdsn00n2p9hy9hz2jmw5z5wfl3w9r-nss-3.102.drv, it's empty :/sudo nix-store --verify --check-contents
shows around ~80 failures in the store (wrong hash, which might be because of unexpected shutdowns?!. The command finishes with the weird :warning: not all store errors were fixed.
. Since it was run without--repair
, i dont think it tried to fix any error so this specific message is weird: either no message orwarning: no repair was done: rerun with --repair
.I then tried to actually repair the paths:
It's not clear why it can't repair the path ? ( as a sidenote I also tried:
)
so I thought I would nee
I am not sure how to proceed to unblock the repair. Maybe delete all the referrers manually ? Isn't it possible to force delete a
.drv
store path ?--ignore-liveness
could become--force
instead for a more standard flag.nix-env --version
outputAdditional context
My laptop oftenu shut down unexpected recently for various reasons, which could explain the wrong store paths.
Priorities
Add :+1: to issues you find important.