not able to connect to Jenkins slave

Not able to connect to jenkins salve by metioned steps in the course. This is error getting logged.

/var/lib/jenkins/.ssh/known_hosts [SSH] No Known Hosts file was found at /var/lib/jenkins/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.

Key exchange was not finished, connection is closed.

java.io.IOException: There was a problem while connecting to 172.31.31.157:22

at com.trilead.ssh2.Connection.connect(Connection.java:834)

at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1166)

at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:834)

at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:821)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.io.IOException: Key exchange was not finished, connection is closed.

at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)

at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)

at com.trilead.ssh2.Connection.connect(Connection.java:786)

... 7 more

Caused by: java.io.IOException: The server hostkey was not accepted by the verifier callback

at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:548)

at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:790)

at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)

... 1 more

[09/04/18 03:38:02] Launch failed - cleaning up connection

[09/04/18 03:38:02] [SSH] Connection closed.


I have added the file with the below command, but still I can see the same issue.

command usee

ssh-keygen -H {IP Address } >> ~/.ssh/known_hosts

Thanks,

Mohan

  • post-author-pic
    Will B
    09-04-2018

    Are you sure you created the file for the jenkins user, or just for your regular user? Try doing a "sudo su - jenkins" and then do the ssh-keygen -H.

  • post-author-pic
    Mohan A
    09-04-2018

    Good point, let me try that


Looking For Team Training?

Learn More