GLIBC problem with nixos-rebuild when switching to nixos-unstable from nixos-19.09?

So, I decided to try to jump into nixos-unstable this weekend (which maybe is a little silly given the impending arrival of 20.03, but I was persuaded that nixos-unstable wasn’t any worse than, say, Arch…), and I’ve run into a problem that looks a bit like issue #84043, except at a more critical point…

Changing channels from nixos-19.09 to nixos-unstable and the initial nixos-rebuild boot --upgrade went fine. Rebooted, and everything seems more-or-less fine (only issue is that I’m seeing problems unlocking kwallet that look like #68316). I made a few more additional tweaks and attempting to rebuild, I now get the following:

unpacking channels...
building Nix...
building the system configuration...
/nix/store/rm1hz1lybxangc8sdl7xvzs5dcvigvf7-bash-4.4-p23/bin/bash: relocation error: /nix/store/an6bdv4phxsz14q2sk57iscl2dc7bnj1-glibc-2.30/lib/ symbol __write_nocancel version GLIBC_PRIVATE not defined in file with link time reference
Traceback (most recent call last):
  File "/nix/store/", line 240, in <module>
  File "/nix/store/", line 209, in main
    write_entry(*gen, machine_id)
  File "/nix/store/", line 95, in write_entry
    subprocess.check_call([append_initrd_secrets, "/boot%s" % (initrd)])
  File "/nix/store/vs4vj1yzqj1bkcqkf3b6sxm6jfy1gb4j-python3-3.7.7/lib/python3.7/", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/i8cmnrjnnc21yix0005sb4y2n9qimxjk-append-initrd-secrets/bin/append-initrd-secrets', '/boot/efi/nixos/p0mkgxr2681w192m6j69ga0lzp3hzhbs-initrd-linux-5.4.24-initrd.efi']' returned non-zero exit status 127.
warning: error(s) occurred while switching to the new configuration

Reverting all of the tweaks to my configuration and attempting a rebuild results in the same error… So it looks like I’m stuck, unable to switch to a new configuration.

Anyone run into something like this, or have any idea how to work-around or resolve?

Hoping I don’t have to figure out how to get back on 19.09 before Monday, since this is my normal desktop… Any help or ideas super-appreciated!

I suspect you might be able to work around it by adding --no-build-nix to the nixos-rebuild command.

Unfortunately, I tried to roll back using my boot menu before I saw the suggestion to us --no-build-nix, only to discover that this error meant that my boot menu was completely empty.

I wound up reinstalling (I did a backup right before in case things went south). If someone else runs into this error and sees this thread, try @vcunat’s suggestion before giving up (like I did), and let posterity know if it worked!

That’s weird. I believe the error you posted happened long before it would touch boot stuff, so I assume there might be a bug when trying to rollback before the first generation?

That’s what I would have thought too, but whatever went wrong wiped everything in /boot except for the loader itself. (In retrospect, I should have checked this before taking such drastic action, but I was panicking a little, as that particular system is my daily driver.)