This is the error message of the machine using binary cache:
warning: error: unable to download 'http://192.168.1.10:5000/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.narinfo': Could not connect to server (7) Failed to connect to 192.168.1.10 port 5000 after 0 ms: Could not connect to server; retrying in 250 ms
This is the error message of the machine hosting nix-server
(journalctl -o with-unit)
nix-serve.service[1234]: 192.168.1.100 - - [10/Jun/2025:08:04:00 +0300] "GET /nix-cache-info HTTP/1.1" 200 - "" "curl/8.13.0 Nix/2.28.3"
nix-daemon.service[5678]: error: error processing connection: user '65432' is not allowed to connect to the Nix daemon
nix-serve.service[1234]: terminate called after throwing an instance of 'nix::Error'
nix-serve.service[1234]: what(): error: cannot open connection to remote store 'daemon': error: reading from file: Connection reset by peer
init.scope[1]: nix-serve.service: Main process exited, code=dumped, status=6/ABRT
init.scope[1]: nix-serve.service: Failed with result 'core-dump'.
init.scope[1]: nix-serve.service: Consumed 88ms CPU time, 18.4M memory peak, 11.1M read from disk, 664B incoming IP traffic, 462B outgoing IP traffic.
nix-serve related config nix-serve.nix
:
{pkgs, ...}: {
services.nix-serve = {
package = pkgs.nix-serve-ng;
enable = true;
secretKeyFile = "/path/of/the/nix/serve/private/key.pem";
openFirewall = true;
};
}
systemctl restart nix-serve
not restarting the service in the machine hosting nix-serve. It was stuck with Active: activating (auto-restart) (Result: core-dump)
error message in systemctl status nix-serve
.
The temporarily solution I tried is to disable the above nix-serve.nix
, do a nixos-rebuild, then enable the above nix-serve.nix
again, then do a nixos-rebuild again. Then the nix-serve
systemd service will be working (for only a very limited period of time, and later the above messages appears again).
The problem appears about 2 days ago.