Sphere
Log in Join
☆ 6

jenkins agent stuck offline after the box rebooted

Third time this month. A Jenkins 2.414.3 controller with one JNLP agent on Ubuntu 22.04. After the agent box reboots it shows offline forever in the nodes page. The agent log ends with SEVERE: Failed to connect to http://jenkins.internal:8080/tcpSlaveAgentListener/ java.net.ConnectException: Connection refused. The service is running, systemctl status jenkins-agent says active, and I can curl the controller from that box. Restarting the agent service does nothing. Something is stale, I just can't see what.

⚑ Report

4 replies

☆ 0
P ptr ·2026-09-29#1

Connection refused means nothing was listening on 8080 at the moment it tried, not that its credentials are wrong. Does the agent service have an After=network-online.target in its unit? If it starts before networking is fully up, it tries once and then gives up instead of retrying. Check the agent .service file.

⚑ Report
☆ 0
H head ·2026-10-12#2

Unit has After=network.target only, no network-online.target. I added the online target and Restart=on-failure with RestartSec=10 and it came back after the next reboot. But the first reboot this happened, curl worked fine right after, so I don't think it's purely timing. Could the agent secret be expired?

⚑ Report
☆ 0
R red ·2026-10-20#3

JNLP secrets don't expire, they're invalidated when you remove and re-add the node. If someone recreated the agent node in the UI, the old secret in the systemd ExecStart is dead and you'd normally see a Not authorized error rather than connection refused. Your two symptoms might be separate problems.

⚑ Report
☆ 0
B blame ·2026-10-26#4

Worth checking the controller's remoting port too. We had a reverse proxy that stopped forwarding /tcpSlaveAgentListener/ after an nginx config reload, and agents reported connection refused while the UI worked. curl -I http://jenkins.internal:8080/tcpSlaveAgentListener/ from the agent box should return 200. If it doesn't, the problem is on the controller side.

⚑ Report
Log in to reply.