Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to switch to the latest generation on unstable #12162

Open
2 tasks done
iopq opened this issue Jan 9, 2025 · 3 comments
Open
2 tasks done

Unable to switch to the latest generation on unstable #12162

iopq opened this issue Jan 9, 2025 · 3 comments
Labels

Comments

@iopq
Copy link

iopq commented Jan 9, 2025

Describe the bug

When I updated my flake and tried to switch to the new generation, it failed with


[iopq@desktop:~]$ sudo nixos-rebuild switch
[sudo] password for iopq: 
warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
evaluation warning: qt6Packages.stdenv is deprecated. Use stdenv instead.
terminate called after throwing an instance of 'nix::Error'
  what():  error: cannot determine user's home directory
Traceback (most recent call last):
  File "/nix/store/sk24hzhak6cy37g7yq9yyb6c93csjv7s-systemd-boot/bin/systemd-boot", line 431, in <module>
    main()
  File "/nix/store/sk24hzhak6cy37g7yq9yyb6c93csjv7s-systemd-boot/bin/systemd-boot", line 414, in main
    install_bootloader(args)
  File "/nix/store/sk24hzhak6cy37g7yq9yyb6c93csjv7s-systemd-boot/bin/systemd-boot", line 357, in install_bootloader
    gens = get_generations()
           ^^^^^^^^^^^^^^^^^
  File "/nix/store/sk24hzhak6cy37g7yq9yyb6c93csjv7s-systemd-boot/bin/systemd-boot", line 213, in get_generations
    gen_list = run(
               ^^^^
  File "/nix/store/sk24hzhak6cy37g7yq9yyb6c93csjv7s-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/bin/nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system']' died with <Signals.SIGABRT: 6>.
Failed to install bootloader

Steps To Reproduce

sudo nixos-rebuild switch

Expected behavior

switch should succeed

Metadata

nix-env (Nix) 2.24.11

sudo /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/bin/nix-env --list-generations -p /nix/var/nix/profiles/system

returns a list of generations


Add 👍 to issues you find important.

@iopq iopq added the bug label Jan 9, 2025
@iopq
Copy link
Author

iopq commented Jan 9, 2025

the command that fails is

sudo systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER= --collect --no-ask-password --pipe --quiet --service-type=exec --unit=nixos-rebuild-switch-to-configuration --wait /nix/store/y93s787hifig9pf2z4w8h1x4a5cwmqwp-nixos-system-desktop-25.05.20250104.8f3e1f8/bin/switch-to-configuration switch

I manually ran

sudo /nix/store/y93s787hifig9pf2z4w8h1x4a5cwmqwp-nixos-system-desktop-25.05.20250104.8f3e1f8/bin/switch-to-configuration switch

then everything worked again for a bit, and then failed again when I changed the configuration

nix-profile also has some errors

@iopq
Copy link
Author

iopq commented Jan 9, 2025

nix shell gives this error

[iopq@desktop:~]$ nix-shell -p nvtop
error:
       … while calling the 'import' builtin
         at «string»:1:18:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nvtop) ]; } ""
             |                  ^

       … while realising the context of a path

       … while calling the 'findFile' builtin
         at «string»:1:25:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nvtop) ]; } ""
             |                         ^

       error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused

@iopq
Copy link
Author

iopq commented Jan 9, 2025

The issue is somehow my entire /nix folder is owned by another user which runs the proxy program which causes
every permission problem possible

after i chowned some folders I got a new error message:

terminate called after throwing an instance of 'nix::Error'
  what():  error: cannot determine user's home directory
/run/current-system/sw/bin/nixos-rebuild: line 216:  8058 Aborted                 (core dumped) "$@"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant