NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.86k stars 1.45k forks source link

Assertion failure in `outputsSubstitutionTried` #10092

Open t4ccer opened 5 months ago

t4ccer commented 5 months ago

Describe the bug

When running nix develop it stops with error: Nix daemon disconnected unexpectedly (maybe it crashed?). In daemon logs I can see

$ journalctl -u nix-daemon.service -n2
Feb 26 19:46:26 voyager nix-daemon[1567]: accepted connection from pid 3366293, user t4ccer (trusted)
Feb 26 19:46:57 voyager nix-daemon[3366304]: nix-daemon: src/libstore/build/derivation-goal.cc:326: void nix::DerivationGoal::outputsSubstitutionTried(): Assertion `false' failed.

I'm sorry for not being able to provide more details because after waiting ~30 minutes it stopped happening (probably remote builder and binary cache caught up and substituted before hitting this) and I cannot reproduce it myself now. I hope that it still may be a valuable report.

Expected behavior

It doesn't happen.

nix-env --version output

nix-env (Nix) 2.19.3

Additional context

Add any other context about the problem here.

Priorities

Add :+1: to issues you find important.

roberth commented 5 months ago

This assertion was introduced here https://github.com/NixOS/nix/pull/6312/files#diff-5784d1ad7c22601c75b86872534049bea5173377de5d61b7446452beabc16d3fR323

teto commented 2 months ago

I can reproduce this deterministically on a private project. nix develop would fail with: nix-daemon: src/libstore/unix/build/derivation-goal.cc:335: void nix::DerivationGoal::outputsSubstitutionTried(): Assertionfalse' failed.`

Before failing, the nix develop shows

warning: ignoring substitute for '/nix/store/j1hbm4czfvv8jp6bm1qzxj8ykmxx5isb-gstreamer-1.22.9' from 's3://REDACTED_PRIVATE_NIX_CACHE', as it's not signed by any of the keys in 

nix develop works well for other projects (that dont have the substitution issue).

This happens with

➜ nix --version
nix (Nix) 2.22.1

I can work around it by disabling the cache with bad signatures `nix develop --option substituters 'https://cache.nixos.org/' works but sadly this is one of the project with a long time build. I guess I could fix those signatures as well ^^''

teto commented 2 months ago

I just saw there was a 2.23.0. I've enabled it and it seems to fix the issue.

teto commented 1 month ago

not sure if I messed up my previous test or if 2.23.1 regressed but with 2.23.1 I had it again nix-daemon: src/libstore/build/derivation-goal.cc:303: void nix::DerivationGoal::outputsSubstitutionTried(): Assertionfalse' failed.`. Patching the assert out works though

atropos112 commented 1 month ago

After updating flake.lock on my nixos configuration, while on nix version 2.18.4 (on latest nixos) I encounter the same error now. Tried with nix 2.23.1, 2.22 and 2.21 and am seeing the same result.

atropos112 commented 1 month ago

I no longer observe this issue on unstable branch

Weathercold commented 6 days ago

Still happening with 2.23.3 on Arch. No issue after downgrading to 2.15.0.