Closed flokli closed 4 years ago
If I reboot after this error, will the system be ok then? Is it just that the switching of the running system somehow doesn't work properly but if you reboot afterwards, it works fine? Or is there something broken in the system if I see this error and rebooting doesn't help?
I found that this error usually goes away after re-running the rebuild command.
This now also affects 19.09 (stable release). I think https://github.com/NixOS/nixpkgs/pull/76785 is the cause.
"x86_64-linux"
Linux 5.3.13, NixOS, 19.09.1748.ad1e1af5ad3 (Loris)
yes
yes
nix-env (Nix) 2.3.1
"nixos-19.09.1748.ad1e1af5ad3, nixos-unstable-20.03pre202088.e89b21504f3"
"home-manager-19.09"
/nix/var/nix/profiles/per-user/root/channels/nixos
I think it happens during large upgrades during which nix is upgraded. It would make sense to not restart nix mid-script but rather do it at the end, if that's what's causing it.
the ${nix}/bin/nix ping-store --no-net
within the activation script should probably be changed over to:
${nix}/bin/nix ping-store --no-net --store local
that tells nix to just open /nix
directly, rather then reaching out to a nix-daemon
to get things done
@cleverca22 this will still fail parts of activation if you restart services somehow interacting with the nix store. An alternative would be to restart the nix daemon if it has changed before doing that for all other units.
Do we have a fix somewhere ? it is happening in prod and breaking our deploys on 19.09.
I am happy to write a PR, just not sure to understand what to touch
@DianaOlympos I assume nixos/modules/system/activation/switch-to-configuration.pl
needs to be updated to restart nix-daemon.service
(if necessary), then restart the rest of the services.
Oh my, i will really write some perl. Not sure i am the best for this one :smile: Especially the switch, i had problems reading it before. Ok will try to have a look, if noone else can.
It does affect 19.09
so i think it is even worse.
This will stop the previously running nix-daemon.service
but the activation phase needs it. So i am not 100% sure of what to do here ? I can't restart the daemon because i am not activated yet... no ? Or should we filter the nix-daemon
out of the stop list and then restart it at the end ? but then we may have a nix
version that is not the one used by the nix-daemon
.
Or i missed something
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/help-wanted-updating-nix-as-part-of-nixos-rebuild-switch/5785/1
Facing same issue on 19.09 :-( Still no fix/crunch?
https://discourse.nixos.org/t/help-wanted-updating-nix-as-part-of-nixos-rebuild-switch/5785/2?u=dianaolympos This is the best we have from @mkg20001 but i do not have the time to do it right now nor the brain power.
If someone want to do it though and to push it into 20.03 it would be nice. It will not solve the problem we face when going from 19.09 as released (AMI) into 19.09 current stable, but at least it would provide a path forward.
I actually tried to disable both services restarting/reloading, did not help (I actually use NixOps to deploy 19.09 to AWS EC2 running NixOS 19.09 AMI) ` /* systemd.services.nix = { reloadIfChanged = false; restartIfChanged = false; stopIfChanged = false; };
systemd.services.nix-daemon = { reloadIfChanged = false; restartIfChanged = false; stopIfChanged = false; }; */
`
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/spurious-errors-while-rebuilding/4782/2
Fixed in #87182.
IIUC, this fix is only on master, not on the 20.03 branch? Just want to confirm since I'm still seeing this issue on systems running 20.03.
I've just submitted https://github.com/NixOS/nixpkgs/pull/89191 which hopefully backports the relevant fixes from #87182, so as to fix this on 20.03 without breaking backwards-compatibility on the API of nixos-install.
Feel free to test and confirm this works as intended! Reopening as missing backport for the time being :)
Describe the bug On switching, NixOS stops the nix-daemon, then parts in the "nix" snippet of the activation script fail, then it starts the nix-daemon again.
To Reproduce Steps to reproduce the behavior:
Expected behavior nix-daemon updates are handled in a more graceful fashion.
Metadata
Output: