During upgrade: Assertion 'result == ecSuccess || result == ecFailed || result == ecNoSubstituters' failed
bug
## Describe the bug
Received the following output when updating NixOS (It was actually an upgrade from 25.11 to 26.05 if it matters). For transparency I'm including several errors relating to my flaky internet; this is hardly uncommon but normally eventually it sorts itself out. My memory fails me with regards to whether "sorting itself out" involves me rerunning the rebuild command.
The actual issue for which I'm opening this bug is the bit at the bottom that says "This is a bug."
```warning: unable to download 'https://cache.nixos.org/nar/01qrxs9901nzanc2mwccaaa58c8s2a1yjli0rqyavlphsphsnlp7.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 7421952 in 2254 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/1ix6jx7kj02v0bigna92fngmkdcf1hsji59wf0xr8pi1p2pn65hg.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 1671168 in 2523 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/00w27gdjfljiz1pbid1cy1s5956gbqirjqjqs41azsqpc3gvjcgw.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 7487488 in 2565 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/0hwks8pdwzr9yyk90pr2p916l7qas57smw3jrwaay5fk6c1k4q1k.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 11612701 in 2040 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/07wmq9vvlz882fd591sq4phfjdppsgbi9k8gbbk6xjv9dvz9qwbd.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 114688 in 2777 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/0ajqy7nbb8dydhyp2qz4bxw04fc0ibgjlv7pc9inqc0mlv48sqya.nar.zst': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 9056349 in 2013 ms (attempt 4/5)
warning: unable to download 'https://cache.nixos.org/nar/1dbl14jz9bwh2nil8m060llrrjbsm0znv0kvs9ixhf2nqjmhfphb.nar.xz': Timeout was reached (28) Operation too slow. Less than 1 bytes/sec transferred the last 300 seconds; retrying from offset 1086167 in 2374 ms (attempt 4/5)
error: unable to download 'https://cache.nixos.org/l2885xb2yal2w3g24z57xdwkvqyp3j7d.narinfo': Failed sending data to the peer (55) OpenSSL SSL_read: OpenSSL/3.6.2: error:0A000126:SSL routines::unexpected eof while reading, errno 0
error: path '/nix/store/l2885xb2yal2w3g24z57xdwkvqyp3j7d-iso-codes-4.20.1' is required, but there is no substituter that can build it
error: unable to download 'https://cache.nixos.org/iq1pcns688mzilimz10294nj4774hprn.narinfo': Failed sending data to the peer (55) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0
error: path '/nix/store/iq1pcns688mzilimz10294nj4774hprn-jansson-2.15.0' is required, but there is no substituter that can build it
error: some references of path '/nix/store/1la82bzrhigg8ksjcqdpib1dfbnwy7dc-gst-plugins-base-1.26.11' could not be realised
error: some references of path '/nix/store/xmgxsgh8cwavmpphhi0n2aa9i28nv2mx-networkmanager-1.56.0' could not be realised
error: some references of path '/nix/store/i2r017xv13kb0qlhm8rmvfynw2l2ijvk-samba-4.23.8' could not be realised
error: some references of path '/nix/store/8c0vf399daba9dsf45vifsi22hbkpfpd-additional-cups-backends' could not be realised
error: some references of path '/nix/store/wh3cls1m5w1a4bznfgnikk3a8zn31wrl-ffmpeg-full-7.1.5-lib' could not be realised
error: some references of path '/nix/store/skk4hyggqsks4clm4pialwq3kqyd2l7f-pipewire-1.6.5' could not be realised
error: some references of path '/nix/store/23i2cwlf4r3c5d2dzyinnnsbm1h1i1yw-ffmpeg-full-7.1.5-bin' could not be realised
[0/1025 built (1 failed), 16/220/2098 copied (2 failed) (500.9 MiB/19.4 GiB), 137.2 MiB/5.2 GiB DL] querying iso-codes-4.20.1 on https://cache.nixos.org
terminating due to unexpected unrecoverable internal error: Assertion 'result == ecSuccess || result == ecFailed || result == ecNoSubstituters' failed in nix::Goal::Done nix::Goal::amDone(ExitCode) at ../build/goal.cc:204
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# 0x00000000001124AE 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# 0x00000000000E92EF in /nix/store/l5p52saf0rh1fspzwfx32813pb1ap597-nix-util-2.34.7/lib/libnixutil.so.2.34.7
4# __wrap___assert_fail in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
5# 0x00000000000BD59C in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
6# 0x00000000001B5A0E in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
7# nix::Goal::work() in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
8# nix::Worker::run(std::set<std::shared_ptr<nix::Goal>, nix::CompareGoalPtrs, std::allocator<std::shared_ptr<nix::Goal> > > const&) in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
9# nix::Store::buildPathsWithResults(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, nix::BuildMode, std::shared_ptr<nix::Store>) in /nix/store/0hin4abpq9yk7zrl1x0v0yaw1x8yjpy6-nix-store-2.34.7/lib/libnixstore.so.2.34.7
10# 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/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
11# 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/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
12# 0x0000000000103A0E in nix
13# 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/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
14# nix::RawInstallablesCommand::run(nix::ref<nix::Store>) in /nix/store/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
15# nix::StoreCommand::run(nix::ref<nix::StoreConfig>) in /nix/store/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
16# virtual thunk to nix::StoreConfigCommand::run() in /nix/store/iqq6r5w7bbjrdvs5dg3mshj1bm6cxsx6-nix-cmd-2.34.7/lib/libnixcmd.so.2.34.7
17# 0x000000000019FADB in nix
18# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::fun<void ()>) in /nix/store/l5p52saf0rh1fspzwfx32813pb1ap597-nix-util-2.34.7/lib/libnixutil.so.2.34.7
19# 0x00000000000E1A0B in nix
20# 0x000000000002B285 in /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libc.so.6
21# __libc_start_main in /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libc.so.6
22# 0x00000000000E6675 in nix
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths 'path:/home/jeremy/development/nixos#nixosConfigurations."jackalope".config.system.build.toplevel' --no-link --refresh' died with <Signals.SIGABRT: 6>.
```
## Steps To Reproduce
Severely throttle or disconnect the internet partway through a rebuild. In my case this happened several times (always following errors regarding failed downloads), but eventually I was able to successfully complete the build which makes me suspect that it's simply caused by poor error handling in this situation.
## Expected behavior
The assertion referenced in the log should either succeed or be modified if upon review it is determined to be incorrect.
## Metadata
nix-env (Nix) 2.31.4
## Additional context
I'm not sure what context could be useful, but I'll do my best to answer whatever questions there may be.
## Checklist
<!-- make sure this issue is not redundant or obsolete -->
- [x] checked [latest Nix manual] \([source])
- [x] checked [open bug issues and pull requests] for possible duplicates
- [x] reviewed the [contributing guide]
[latest Nix manual]: https://nix.dev/manual/nix/development/
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
[open bug issues and pull requests]: https://github.com/NixOS/nix/labels/bug
[contributing guide]: https://github.com/NixOS/nix/blob/master/CONTRIBUTING.md
---
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
1 条评论