Closed the-sun-will-rise-tomorrow closed 3 months ago
You may want to rerun the second invocation with --narinfo-cache-negative-ttl 0
. It's likely Nix is querying the substituter, noticing that it doesn't have the path, and then storing the fact it wasn't there in the database (so that it doesn't need to do slow networking every time and ask the substituter for a path it doesn't (didn't) have).
Yes, that was it. Thank you!
Where is that persisted? I tried to delete ~/.cache/nix before every invocation (which didn't work) and checked every file in /nix/var
and couldn't find any relevant mentions of the cache.
Also, would it make sense to add some logging for this? I couldn't see any explanation for why it was making that decision even at the maximum log level.
Something to keep in mind is that, when running Nix as a daemon, it is essentially running as root, so you'd also need to have cleared ~root/.cache/nix
(usually that's just /root/.cache/nix
).
EDIT: But yeah, if there isn't already logging about this, there probably should be. I can try to have a look at that later.
Something to keep in mind is that, when running Nix as a daemon, it is essentially running as root, so you'd also need to have cleared
~root/.cache/nix
(usually that's just/root/.cache/nix
).
I did not think to look there. Thank you!
Describe the bug
Nix sometimes does not use configured substituters after a garbage collection.
Steps To Reproduce
nix-build -vv --no-out-link -E 'let pkgs = import <nixpkgs> {} ; in pkgs.stdenv.mkDerivation { name="test1237"; dontUnpack = true; buildPhase = "echo OK > $out"; }'
nix-store --gc
)Expected behavior
It should grab it from the binary cache, something like this:
Actual behavior
For some reason it sometimes doesn't check the substituter at all.
nix-env --version
outputnix-env (Nix) 2.17.1
Additional context
Trying to setup up a binary cache at $dayjob and it's not looking good :(
Priorities
Add :+1: to issues you find important.