SSH keepalive timed out
WARN[12:00:00] SSH keepalive timed out after 15s
WARN[12:00:00] Connection lost, reconnecting: https://myapp.a.2na.am
A variant:
ERRO[12:00:00] SSH keepalive failed: EOF
These lines appear in the tuna CLI and Tuna Desktop logs. The client doesn't exit; it reconnects. With --log-level=debug, the original error shows up as Keepalive timeout.
Causeโ
Every 5 seconds, the client sends the node a connection check (keepalive) over the tunnel's SSH connection. If there's no reply for 15 seconds or the connection fails with an error, the client considers it dead, closes it, and connects again.
Usually the connection silently died somewhere along the way: the network changed, the laptop went to sleep, a VPN or NAT dropped a long-lived connection, or the link is congested.
What to doโ
A single line after sleep or a network change is normal; the tunnel recovers on its own.
If the timeouts keep coming back:
- Run
tuna diagnoseand check the latency to the nodes, see self-diagnosis. - Check whether a VPN or firewall cuts long-lived connections: exclude
api.tuna.amand the nodes from the VPN, and allow the addresses from the list. - If the host has IPv6, try
TUNA_FORCE_IPV4=1โ see Tunnel fails to connect because of IPv6. - Update the client to the latest version by following the instructions.