Windows agent offline or unable to connect

1 minute read

Issue

  • Jenkins agent offline

  • Jenkins agent unable to connect

Environment

  • CloudBees Jenkins Enterprise (CloudBees Jenkins Platform)

  • WMI Windows Agents

Resolution

Re-create agent by doing the following:

1) Remove $JENKINS_HOME/nodes/{agentname}/config.xml

2) Restart both the agent (process) and the Jenkins controller (the instance running CloudBees Jenkins Enterprise)

The 2.50 (and newer) versions of remoting (agent.jar) adds support for connecting through a proxy. If you have the http_proxy environment variable or the http.proxyHost system property defined for the agent process, it won’t be able to connect to the controller. If needed, please remove these and restart the Windows agent, then attempt to re-connect. If you are running CloudBees Jenkins Enterprise 1.609.1.1 or newer, you should have 2.50 or newer…​unless you upgraded from a previous release and the Windows agents didn’t get updated.

Updating The Windows Agent

If necessary, use this procedure to update the Windows agent to the version bundled with your CloudBees Jenkins Enterprise release…​

1) Retrieve the version from {Jenkins_controller_URL}/jnlpJars/agent.jar

2) Stop the agent process (service) on the Windows agent

3) Delete the existing agent.jar on each Windows agent and replace it with the newly retrieved version.

4) Start the agent process (service) on the Windows agent

Windows Agent Installer module for Jenkins

The best option is upgrading your agents to use Windows Agent Installer module for Jenkins and they take advantage from the automatic upgrades. Doing it so, the next remoting module upgrades for your Windows agents will be aligned with your Jenkins core upgrade automatically.