Skip to content

Assertion '!awake.empty()' failed in void nix::Worker::run() #16005

Closed

Description

@ahk2

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


Add 👍 to issues you find important.

Activity

  1. LyesSaadi commented on Jul 19, 2026

    @LyesSaadi

    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.

  2. tbehner commented on Jul 20, 2026

    @tbehner

    I have the same/similar error on our CI:

    terminating due to unexpected unrecoverable internal error: Assertion '!awake.empty()' failed in void nix::Worker::run(const nix::Goals&) at /build/source/src/libstore/build/../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# 0x000000000013191A in nix
     1# 0x00000000000C539A in /nix/store/hngmi01i8wgi25a0byrxcn4ysz5j79mw-gcc-15.2.0-lib/lib/libstdc++.so.6
     2# std::unexpected() in /nix/store/hngmi01i8wgi25a0byrxcn4ysz5j79mw-gcc-15.2.0-lib/lib/libstdc++.so.6
     3# 0x00000000000D0DAF in /nix/store/pididb1hqqd7prbjiwzn368i1w7kkirk-nix-util-2.35.1/lib/libnixutil.so.2.35.1
     4# __wrap___assert_fail in /nix/store/rpf5lbncqd929fhk7l829zlgz4q9wb90-nix-store-2.35.1/lib/libnixstore.so.2.35.1
     5# 0x00000000000D87BB in /nix/store/rpf5lbncqd929fhk7l829zlgz4q9wb90-nix-store-2.35.1/lib/libnixstore.so.2.35.1
     6# nix::Store::buildPathsWithResults(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, nix::BuildMode, std::shared_ptr<nix::Store>) in /nix/store/rpf5lbncqd929fhk7l829zlgz4q9wb90-nix-store-2.35.1/lib/libnixstore.so.2.35.1
     7# nix::Installable::build2(nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::vector<nix::ref<nix::Installable>, std::allocator<nix::ref<nix::Installable> > > const&, nix::BuildMode) in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
     8# nix::Installable::build(nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::vector<nix::ref<nix::Installable>, std::allocator<nix::ref<nix::Installable> > > const&, nix::BuildMode) in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
     9# 0x000000000012F6CB in nix
    10# nix::InstallablesCommand::run(nix::ref<nix::Store>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&&) in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
    11# nix::RawInstallablesCommand::run(nix::ref<nix::Store>) in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
    12# nix::StoreCommand::run(nix::ref<nix::StoreConfig>) in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
    13# virtual thunk to nix::StoreConfigCommand::run() in /nix/store/5apaja04nvfdbb6v1x0iwnxkyjw70zrv-nix-cmd-2.35.1/lib/libnixcmd.so.2.35.1
    14# nix::mainWrapped(int, char**) in nix
    15# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::fun<void ()>) in /nix/store/pididb1hqqd7prbjiwzn368i1w7kkirk-nix-util-2.35.1/lib/libnixutil.so.2.35.1
    16# main in nix
    17# 0x000000000002B285 in /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libc.so.6
    18# __libc_start_main in /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libc.so.6
    19# _start in nix
    /bin/sh: line 246:   178 Aborted                    (core dumped) nix build --quiet --print-build-logs --no-write-lock-file --impure "$CONTAINER_FLAKE#$NIX_IMAGE_OUTPUT"
    

    The pipeline is running on a gitlab runner on a nixos:latest image.

  3. xokdvium commented on Jul 20, 2026

    @xokdvium
    Contributor

    The stack trace isn't immediately useful here. Could you try collecting debug logs (-vvvvvvvvv or --debug). Do you have something like --keep-going set? Does this happen in the happy path or when nix encounters build/substitution errors?

  4. tbehner commented on Jul 20, 2026

    @tbehner

    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.

  5. LyesSaadi commented on Jul 26, 2026

    @LyesSaadi

    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.

  6. xokdvium commented on Jul 26, 2026

    @xokdvium
    Contributor

    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.

  7. LyesSaadi commented on Jul 26, 2026

    @LyesSaadi

    I have changed my CIs to add --debug, and it crashed again during a nix 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.

  8. xokdvium commented on Jul 27, 2026

    @xokdvium
    Contributor

    Hm ok, this is indeed helpful (that's right before the crash):

    skipping build of derivation '/nix/store/6gc23jl32lnaqv2ycch1m1igqm6hys35-unit-systemd-journald-.service.drv', someone beat us to it
    

    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.

  9. added
    regression
    on Jul 27, 2026
  10. domenkozar commented on Aug 13, 2026

    @domenkozar
    Member

    fixed in fba3f6e

  11. marked Nix crash #16321 as a duplicate of this issue on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregression

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions