NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.17k forks source link

Auto-upgrade builds w/o downloaded channel #261495

Open vrifox opened 1 year ago

vrifox commented 1 year ago

Describe the bug

With enabled auto-upgrade and network issues (Wi-Fi), the build will continue, even if it can’t download the main channel (23.05). The result is a broken/bare-bones system without any programs except the standard ones. Furthermore, I got generation names with 4xxx instead of 2023.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Flake with system.autoUpgrade.enable = true
  2. Start the system and wait 5 minutes
  3. This happens:
    Okt 16 19:34:33 toru nixos-upgrade-start[1716]: warning: error: unable to download 'https://nixos.org/channels/nixos-23.05': Timeout was reached (28); retrying in 349 ms
    Okt 16 19:39:33 toru nixos-upgrade-start[1716]: warning: error: unable to download 'https://nixos.org/channels/nixos-23.05': Timeout was reached (28); retrying in 524 ms
    Okt 16 19:44:34 toru nixos-upgrade-start[1716]: warning: error: unable to download 'https://nixos.org/channels/nixos-23.05': Timeout was reached (28); retrying in 1007 ms
    Okt 16 19:45:55 toru nixos-upgrade-start[1716]: unpacking channels...
    Okt 16 19:46:11 toru nixos-upgrade-start[5282]: this derivation will be built:
    Okt 16 19:46:11 toru nixos-upgrade-start[5282]:   /nix/store/5pzsg7d7sbp6y454w89nf884b9vaimzc-nixos-rebuild.drv
    Okt 16 19:46:11 toru nixos-upgrade-start[5282]: these 62 paths will be fetched (23.06 MiB download, 102.31 MiB unpacked):
    […]

Expected behavior

The system should not build and instead throw an error.

Additional context

The same flake works fine on my Desktop, where I use a wired connection.

Notify maintainers

@pennae

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.57, NixOS, 23.05 (Stoat), 23.05.20231013.898cb20`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - channels(root): `"nixos-23.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
pennae commented 1 year ago

sorry, but you tagged the wrong person. only ever touched documentation for this module, not the logic itself

eclairevoyant commented 1 year ago

Just to confirm, if you're using a flake for system config, are you also setting system.autoUpgrade.flake? If so what value is being set?

vrifox commented 1 year ago

@eclairevoyant I did not realize this option existed. The only option for system.autoUpgrade I set was enable = true;.