Failed to synthesize after upgrade to 23.11

Hello,

I just wanted to update to 23.11 from 23.05 and I get this strange error:

sudo nixos-rebuild switch --upgrade                              Sat Mar 16 10:54:40 2024
[sudo] password for xxx: 
unpacking channels...
building Nix...
building the system configuration...
trace: warning: The option `fonts.fonts' defined in `/etc/nixos/configuration.nix' has been renamed to `fonts.packages'.
failed to synthesize: failed to canonicalize /nix/var/nix/profiles/system-288-link: No such file or directory (os error 2)
Traceback (most recent call last):
  File "/nix/store/j1np2nhgzpaxlqjd8jxaakgiw5q2dzvw-systemd-boot/bin/systemd-boot-builder", line 343, in <module>
    main()
  File "/nix/store/j1np2nhgzpaxlqjd8jxaakgiw5q2dzvw-systemd-boot/bin/systemd-boot-builder", line 331, in main
    install_bootloader(args)
  File "/nix/store/j1np2nhgzpaxlqjd8jxaakgiw5q2dzvw-systemd-boot/bin/systemd-boot-builder", line 287, in install_bootloader
    remove_old_entries(gens)
  File "/nix/store/j1np2nhgzpaxlqjd8jxaakgiw5q2dzvw-systemd-boot/bin/systemd-boot-builder", line 196, in remove_old_entries
    bootspec = get_bootspec(gen.profile, gen.generation)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/j1np2nhgzpaxlqjd8jxaakgiw5q2dzvw-systemd-boot/bin/systemd-boot-builder", line 97, in get_bootspec
    boot_json_str = subprocess.check_output([
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/yvhwsfbh4bc99vfvwpaa70m4yng4pvpz-python3-3.11.8/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/yvhwsfbh4bc99vfvwpaa70m4yng4pvpz-python3-3.11.8/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/k92jac7pcc6yvy4adpkgbyh22d6s8j5s-bootspec-1.0.0/bin/synthesize', '--version', '1', '/nix/var/nix/profiles/system-288-link', '/dev/stdout']' returned non-zero exit status 1.
warning: error(s) occurred while switching to the new configuration

I wanted to see what files are there when the system-288-link is missing:

ls /nix/var/nix/profiles/                                        Sat Mar 16 11:08:41 2024
default                                 system-287-link
default-10-link                         system-288-link.tmp-4121466-1819997941
per-user                                system-289-link
system

Does anyone has an idea what might have happend here?
Thanks in advance!

Does anyone have any thoughts on this? I still couldn’t figure it out…

Switching back to the channel 23.05 I now get this error:

building Nix...
building the system configuration...
Traceback (most recent call last):
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 341, in <module>
    main()
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 310, in main
    raise e
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 299, in main
    write_entry(*gen, machine_id, current=is_default)
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 111, in write_entry
    kernel = copy_from_profile(profile, generation, specialisation, "kernel")
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 84, in copy_from_profile
    copy_if_not_exists(store_file_path, "/boot/efi%s" % (efi_file_path))
  File "/nix/store/yy2r86538ai58lfjmszjk61597cl4j6y-systemd-boot", line 29, in copy_if_not_exists
    shutil.copyfile(source, dest)
  File "/nix/store/h31x3zrwrws1c3392919br8g9isvhh4x-python3-3.10.13/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/nix/var/nix/profiles/system-288-link/kernel'
warning: error(s) occurred while switching to the new configuration

I fixed it by renaming the folder /nix/var/nix/profiles/system-288-link.tmp-4121466-1819997941 to /nix/var/nix/profiles/system-288-link