How to troubleshoot JNLP slaves connection issues with Jenkins

Issue

Your JNLP slave cannot be connected with your Jenkins master.

Environment

  • CloudBees Jenkins Enterprise
  • CloudBees Jenkins Operations Center

Resolution

Ensure that the Java version is at least on the same line on both master and slave

A good practice is to run the exactly same Java version in both Jenkins and slave, but when this is not possible it is recommendable to be running at least the same base line.

Run java -version in both Jenkins master box and slave to check the java version you are running in both.

Ensure that the version of slave.jar matches with the one

The main problem of running JNLP as a slave Launcher is that when you upgrade Jenkins slave.jar is not automatically upgraded on the slave - which by the way happens in SSH Launcher out of the box.

Check that slave.jar is the same using for example md5sum slave.jar. slave.jar can be downloaded from Jenkins master from the URL below:

http://<JENKINS_URL>/jnlpJars/slave.jar

Use jenkins-cli to check the connection

In the slave box download http:///jnlpJars/jenkins-cli.jar from Jenkins master and execute the command below:

java -jar jenkins-cli.jar -s http://<CJOC_URL>/ --username=<USERNAME> --password=<PASSWORD> help

Check that the JNLP port and hostname are right

Launch the commands below and check that the port and hostname are the right ones:

curl -I http://<JENKINS_URL>/computer/<SLAVE>/slave-agent.jnlp
curl -I  http://<JENKINS_URL>/tcpSlaveAgentListener/

Curl command can be available on a Windows box using for example curl Download Wizard

Load balancer or ha-proxy

If you are using a load balancer or a ha-proxy and you are not running Jenkins on ha mode, you might want to bypass any of them through the Slave advance option of Tunnel connection through.

Information to be attached in case you need to open a Support ticket at CloudBees Support

  • Architecture diagram so we can understand how it looks like your environment
  • md5sum of slave.jar in both boxes
  • Content of http:///computer//slave-agent.jnlp
  • Content of http:///computer//config.xml
  • Output of commands below launched from slave box
curl -I http://<JENKINS_URL>/computer/<SLAVE>/slave-agent.jnlp
curl -I  http://<JENKINS_URL>/tcpSlaveAgentListener/
  • Output from jenkins-cli launched from slave box
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.