Saturday 16 May 2015

Unexpected error in launching a slave. This is probably a bug in Jenkins

Launching a slave agent in Jenkins could result in the below error. This occurs when adding a Linux machine as slave node in Jenkins. Here ssh connection to the Linux server fails.

[05/17/15 00:53:52] [SSH] Opening SSH connection to 192.168.212.18:22.

Permission denied: connect
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
java.lang.IllegalStateException: Connection is not established!
    at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
    at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator.canAuthenticate(TrileadSSHPasswordAuthenticator.java:82)
    at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
    at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1173)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
[05/17/15 00:53:53] Launch failed - cleaning up connection
[05/17/15 00:53:53] [SSH] Connection closed.




One instance where this could be corrected is to enable the publickey authentication in the linux server.

Few steps to do so are as below,


  • Edit the sshd_config file under /etc/ssh to modify the parameters, here we enable the publickey authentication and authorisedKeys.



  • After modifying the file to take effect restart sshd service



  • Then relaunch the slave agent which should be successful.












No comments:

Post a Comment