NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.06k stars 13.39k forks source link

nginx fails during "nixos-rebuild switch" #150050

Open peti opened 2 years ago

peti commented 2 years ago

I use nginx on nixos-unstable to server the mailman web interface. The only configuration I did (in addition to what mailman configures) is:


nginx.virtualHosts."lists.cryp.to".enableACME = true;
nginx.virtualHosts."lists.cryp.to".forceSSL = true;

Now, everything works fine, but during nixos-rebuild switch it get the following errors:

Dec 10 13:29:46 neo systemd[1]: Starting nginx-config-reload.service...
Dec 10 13:29:46 neo systemd[1]: Reloading Nginx Web Server...
Dec 10 13:29:46 neo systemd[23447]: Failed to create destination mount point node '/run/systemd/unit-root/tmp': No such file or directory
Dec 10 13:29:46 neo systemd[23447]: Failed to mount /tmp/systemd-private-e98f6111ca464ce0991c805f0bbb097e-nginx.service-SVPkDL/tmp to /run/systemd/unit-root/tmp: No such file or directory
Dec 10 13:29:46 neo systemd[23447]: nginx.service: Failed to set up mount namespacing: /run/systemd/unit-root/tmp: No such file or directory
Dec 10 13:29:46 neo systemd[23447]: nginx.service: Failed at step NAMESPACE spawning /nix/store/ry13jha9c1dxga8g7k2mjx3r4nq4wmj9-nginx-1.20.2/bin/nginx: No such file or directory
Dec 10 13:29:46 neo systemd[1]: nginx.service: Control process exited, code=exited, status=226/NAMESPACE
Dec 10 13:29:46 neo systemd[1]: Reload failed for Nginx Web Server.

Is this a known problem?

Artturin commented 2 years ago

Pinging people who have recently contributed to the module @Mic92 @mkg20001

Mic92 commented 1 year ago

That's more of a systemd issue. Maybe check if '/run/systemd/unit-root/` exists and if not, give your machine a reboot.

Leonetienne commented 11 months ago

also running into this after following https://nixos.wiki/wiki/Nginx. /run/systemd/unit-root exists, but is empty. Reboot does nothing.

luizribeiro commented 8 months ago

I get this too every now and then. Could this be related to RestrictNamespaces or PrivateTmp, both of which are currently enabled by systemd.services.nginx?

Some more data points: Running systemd reload nginx.service directly results on the same error (as expected). After restarting nginx.service (and nginx-reload-config.service) both services get out of the failed state.