Repository navigation
Closed
Labels
Description
Describe the bug
While doing a nixos-rebuild build -I nixos-config=$(pwd)/configuration.nix on my Ubuntu 24.04 I get the following error:
terminating due to unexpected unrecoverable internal error: Assertion '!awake.empty()' failed in void nix::Worker::run(const nix::Goals&) at ../build/worker.cc:360
Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:
std::terminate() called without exception
Stack trace:
0# 0x000000000011402E in nix-build
1# 0x00000000000C539A in /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libstdc++.so.6
2# std::unexpected() in /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libstdc++.so.6
3# 0x00000000000F949F in /nix/store/qnhccq9ilszgqv7hi4hdxacf00garrpg-nix-util-2.35pre20260504_53ab7375/lib/libnixutil.so.2.35
4# __wrap___assert_fail in /nix/store/bhg9w1kgi1kxkd0mgbi2rgj6dh0dca5l-nix-store-2.35pre20260504_53ab7375/lib/libnixstore.so.2.35
5# 0x00000000000DFC8F in /nix/store/bhg9w1kgi1kxkd0mgbi2rgj6dh0dca5l-nix-store-2.35pre20260504_53ab7375/lib/libnixstore.so.2.35
6# nix::Store::buildPaths(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, nix::BuildMode, std::shared_ptr<nix::Store>) in /nix/store/bhg9w1kgi1kxkd0mgbi2rgj6dh0dca5l-nix-store-2.35pre20260504_53ab7375/lib/libnixstore.so.2.35
7# 0x0000000000206F62 in nix-build
8# 0x000000000020C47C in nix-build
9# 0x00000000001A043F in nix-build
10# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::fun<void ()>) in /nix/store/qnhccq9ilszgqv7hi4hdxacf00garrpg-nix-util-2.35pre20260504_53ab7375/lib/libnixutil.so.2.35
11# 0x00000000000E3371 in nix-build
12# 0x000000000002B285 in /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6
13# __libc_start_main in /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6
14# 0x00000000000E81E5 in nix-build
/nix/store/178wmr0l7fnpj5348ga33sdcf2sd8xyh-nixos-install/bin/nixos-install: line 289: 3260040 Aborted (core dumped) nix-build --out-link "$outLink" --store "$mountPoint" "${extraBuildFlags[@]}" --extra-substituters "$sub" '<nixpkgs/nixos>' -A system -I "nixos-config=$NIXOS_CONFIG" "${verbosity[@]}"
Steps To Reproduce
Not reproducible on my NixOS machine, only seen on my Ubuntu machine. I hope the above stack trace is helpful, because I have no good understanding of what is needed to reproduce it. With the 25.11 release of NixOS it was working.
Expected behavior
No crash.
Metadata
nix-env (Nix) 2.35pre20260504_53ab7375.
Ubuntu 24.04.4 LTS
Additional context
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.
Reacted by tbehner, Lyes Saadi, ergonben and Sreedev Kodichath
Activity
LyesSaadi commentedon Jul 19, 2026
I have the same error happening randomly on my CIs when doing a
nix flake check .:https://git.minish.link/lyes/nixfiles/actions/runs/27/jobs/0/attempt/1
It has a stack trace.
tbehner commentedon Jul 20, 2026
I have the same/similar error on our CI:
The pipeline is running on a gitlab runner on a nixos:latest image.
xokdvium commentedon Jul 20, 2026
The stack trace isn't immediately useful here. Could you try collecting debug logs (
-vvvvvvvvvor--debug). Do you have something like--keep-goingset? Does this happen in the happy path or when nix encounters build/substitution errors?tbehner commentedon Jul 20, 2026
This happened in the happy path, the intermediate targets where even cached. Sadly this is non-deterministic, I ran the pipeline again and everything worked fine.
I will add the debug flag and provide more information as soon as the issue comes up again.
LyesSaadi commentedon Jul 26, 2026
Hello, I don't have more details for the stack trace, but I think I can reproduce a bit more deterministically (though it's still unreliable).
In the same way as with @tbehner, I also cache my builds (using attic). And this seems to happen sometimes when everything nix needs to build for a target is in the cache already.
I had tried that with some CIs, where I let it build after some major updates which were uncached, they succeeded as expected, but, after caching everything that CI built, builds started to fail.
xokdvium commentedon Jul 26, 2026
It would be useful to at least provide the version of nix this has been observed on. In 2.35 we are now waking less coroutines so it might be uncovering a latent bug. Has anyone observed this happening with 2.34 at all?
Maybe we can try to come up with a reproducer for this, but debug logs would help immensely to avoid shooting in the dark - the description is quite vague otherwise.
LyesSaadi commentedon Jul 26, 2026
I have changed my CIs to add
--debug, and it crashed again during anix flake check! I have attached the logs here (beware, it's 68MB of text, and I heavily recommend downloading the file and not trying to preview it in the browser). I might add that this is always happening in happy paths (until the crash). Can't say anything about 2.34 since I had my cache setup only since last week.xokdvium commentedon Jul 27, 2026
Hm ok, this is indeed helpful (that's right before the crash):
I messed up in an assumption that a job being woken while waiting for a build/substitution slot will always use it up and release at the end. That seems to not be the case in case of multiple concurrent processes.
libstore: Fix lost waiting for slot goal wakeups
libstore: Fix lost waiting for slot goal wakeups
ci: retry flaky nix-fast-build runs, fix the invalid systemd drop-in
ci: pin nix to 2.34.8 until the scheduler regression is released-fixed
libstore: Fix lost waiting for slot goal wakeups
domenkozar commentedon Aug 13, 2026
fixed in fba3f6e
Update cachix/install-nix-action action to v31 (#12)
vm-ci: run nix 2.35 so waiting builds don't OOM the daemon