Rebuild is failing due to panick delete_garbage_kernel

It’s been about a month or so since i’ve updated my NixOS setup and am running into the following issue whenever i try to rebuild after updating my flake.

building the system configuration...
error: builder for '/nix/store/l77lbhgya5vnx291fvz419kzsx7km4k4-lzbt-systemd-0.4.1.drv' failed with exit code 101;
       last 25 log lines:
       > /build/.tmpFhLxYK/EFI/Linux
       > /build/.tmpFhLxYK/EFI/Linux/nixos-generation-1-d7tfbe3t6y3jzfzgegsnfrwafuhaqlnoj27bakrldmlmigpkerua.efi
       > /build/.tmpFhLxYK/EFI/Linux/nixos-generation-2-e5y6dpkagpbfucsk25nddaby4plrfpbzhf6tqqozyvjkmocuivpa.efi
       > /build/.tmpFhLxYK/EFI/Linux/nixos-generation-3-d5hccoaeohelbxaugvx4she4k3oyv3nqp47mqeebhv4jot2wbw3a.efi
       > /build/.tmpFhLxYK/EFI/Linux/ubuntu.efi
       > /build/.tmpFhLxYK/EFI/BOOT
       > /build/.tmpFhLxYK/EFI/BOOT/BOOTX64.EFI
       > /build/.tmpFhLxYK/EFI/systemd
       > /build/.tmpFhLxYK/EFI/systemd/systemd-bootx64.efi
       > /build/.tmpFhLxYK/EFI/windows
       > /build/.tmpFhLxYK/loader
       > /build/.tmpFhLxYK/loader/loader.conf
       > /build/.tmpFhLxYK/dell
       > thread 'keep_unrelated_files_on_esp' panicked at systemd/tests/gc.rs:118:5:
       > assertion failed: output1.status.success()
       >
       >
       > failures:
       >     delete_garbage_kernel
       >     keep_only_configured_number_of_generations
       >     keep_unrelated_files_on_esp
       >
       > test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s
       >
       > error: test failed, to rerun pass `-p lzbt-systemd --test gc`
       For full logs, run 'nix log /nix/store/l77lbhgya5vnx291fvz419kzsx7km4k4-lzbt-systemd-0.4.1.drv'.
error: 1 dependencies of derivation '/nix/store/aaxfagk52cx67sxgppigxkshhlxi54qw-lzbt.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nzmg43aqi8912l2wdxhvh9dr6a2bjggq-bootinstall.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wqbm2b0ilq7pff7r1h3a1zbgsmqdlqsy-nixos-system-framework16-25.05.20250129.9d3ae80.drv' failed to build

I’m at a bit of a loss on how to debug this. I’ve checked journalctl and am not sure if this is related?

 31 20:30:01 framework16 kernel: nvme nvme1: 8/0/0 default/read/poll queues
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device descriptor read/64, error -32
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device descriptor read/64, error -32
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: reset full-speed USB device number 9 using xhci_hcd
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device descriptor read/64, error -32
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device descriptor read/64, error -32
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: reset full-speed USB device number 9 using xhci_hcd
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: Device not responding to setup address.
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: Device not responding to setup address.
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device not accepting address 9, error -71
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: WARN: invalid context state for evaluate context command.
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: reset full-speed USB device number 9 using xhci_hcd
Jan 31 20:30:01 framework16 kernel: xhci_hcd 0000:c2:00.3: ERROR: unexpected setup address command completion code 0x11.
Jan 31 20:30:01 framework16 kernel: xhci_hcd 0000:c2:00.3: ERROR: unexpected setup address command completion code 0x11.
Jan 31 20:30:01 framework16 kernel: usb 1-4.2: device not accepting address 9, error -22

I am running NixOS 24.11 on my Framework16 laptop with secureboot enabled through lanzaboote if that helps debug.

Yeah, the logs show that it’s failing to build lanzaboote for whichever reason.

Based on that issue, it seems to be related to a breaking change in systemd v257 (and 24.11 uses v256). So, are you sure that lanzaboote is even supported on stable? If you’re unsure, you should ask that project.

Can you post the flake and the module you are using for lanzaboote?

Ah thanks for your input. I found the issue was that i had lanzaboote pinned to v0.4.1 in my flake. After updating to use whatever is the most recent release things are working again.

2 Likes