Today I updated my NixOS server hosted on Hetzner and could no longer connect via SSH or reach the web services. After chrooting to it with nixos-enter and examining the journal, I noted that the system booted just fine, but there was apparently some issue with networking. I use soju IRC bouncer and noticed in the journal that it failed to connect to the IRC network.
The original networking config was unchanged from the time it was automatically generated by nixos-infect. I decided to try a systemd-networkd based config adapted from this example (I import the separate config file):
{ config, lib, pkgs, ... }: {
# Use systemd networkd
systemd.network.enable = true;
networking.useNetworkd = true;
# Static network configuration (Hetzner)
networking.wireless.enable = false;
networking.useDHCP = false;
networking.usePredictableInterfaceNames = false;
networking.interfaces.eth0 = {
ipv4.addresses = [
{
address = "...";
prefixLength = 32;
}
];
ipv6.addresses = [
{
address = "...";
prefixLength = 64;
}
];
};
networking.defaultGateway = {
address = "172.31.1.1";
interface = "eth0";
};
networking.defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
networking.nameservers = [
"185.12.64.1"
"185.12.64.2"
"2a01:4ff:ff00::add:1"
"2a01:4ff:ff00::add:2"
];
}
In my configuration.nix I have additionally (unchanged):
networking.hostName = "ubuntu-2gb-hel1-1";
networking.domain = "";
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 3001 6697 ];
allowedUDPPorts = [ 3001 ];
};
system.stateVersion is 23.11.
After rebuilding the config and booting the server, I still could not connect to it or reach my websites, but according to the journal the connection to the IRC network worked. Indeed, if I sit in an IRC channel as another user while booting the server, I can see my user joining and the connection has remained steady for 40 mins so far. Here is the journal with the systemd-networkd config.
I don’t notice any other weirdness besides this:
Jun 07 12:08:31 ubuntu-2gb-hel1-1 systemd-networkd-wait-online[894]: Timeout occurred while waiting for network connectivity.
Jun 07 12:08:31 ubuntu-2gb-hel1-1 systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Jun 07 12:08:31 ubuntu-2gb-hel1-1 systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Jun 07 12:08:31 ubuntu-2gb-hel1-1 systemd[1]: Failed to start Wait for Network to be Online.
Jun 07 12:08:31 ubuntu-2gb-hel1-1 systemd[1]: Reached target Network is Online.
Any ideas on where to go from here? I suppose I could build a config where I can log in with a password and use Hetzner’s console to connect to the running system, but what should I inspect?