when i try to run sudo nixos-rebuild switch it gives me this error
building Nix…
building the system configuration…
Assertion ‘n <= st.st_size + 1’ failed at src/basic/efivars.c:110, function efi_get_variable(). Aborting.
Traceback (most recent call last):
File “/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot”, line 431, in
main()
File “/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot”, line 414, in main
install_bootloader(args)
File “/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot”, line 317, in install_bootloader
installed_out = run(
^^^^
File “/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot”, line 58, in run
return subprocess.run(cmd, check=True, text=True, stdout=stdout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/lib/python3.12/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[’/nix/store/2dqf465jfs9w73jihy4yk8yc47673i18-systemd-257.10/bin/bootctl’, ‘–esp-path=/boot’, ‘status’]’ died with <Signals.SIGABRT: 6>.
Failed to install bootloader
warning: error(s) occurred while switching to the new configuration
I second this. Since today I’m getting a very similar error when rebuilding, even though I didn’t change anything besides new fonts (which I reverted but still get the error)
sudo nixos-rebuild switch --flake .#nixos
building the system configuration...
Assertion 'n <= st.st_size + 1' failed at src/basic/efivars.c:110, function efi_get_variable(). Aborting.
Traceback (most recent call last):
File "/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot", line 431, in <module>
main()
File "/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot", line 414, in main
install_bootloader(args)
File "/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot", line 317, in install_bootloader
installed_out = run(
^^^^
File "/nix/store/zlb2i0qml2rmaqc7qdpgkhak0m7fv336-systemd-boot/bin/systemd-boot", line 58, in run
return subprocess.run(cmd, check=True, text=True, stdout=stdout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/2dqf465jfs9w73jihy4yk8yc47673i18-systemd-257.10/bin/bootctl', '--esp-path=/boot', 'status']' died with <Signals.SIGABRT: 6>.
Failed to install bootloader
warning: error(s) occurred while switching to the new configuration
It also looks like I can only reproduce this after resuming from hibernation. I don’t run into this problem after rebooting (until my system goes into hibernation again).
ok so i did some testing and the issue only happens if you return from hibernation and try to sudo nixos-rebuild switch --upgrade after you run that command sudo nixos-rebuild swtich will be broken for the whole hibernation session