Jenkins Master-Slave: Key exchange was not finished, connection is closed

Merowinger picture Merowinger · May 2, 2018 · Viewed 12.7k times · Source

I want to connect a slave to Master-Jenkins, but when trying to connect i'm getting following Error:

[05/02/18 15:26:59] [SSH] Opening SSH connection to <IP>
Key exchange was not finished, connection is closed.
java.io.IOException: There was a problem while connecting to <IP>:22
    at com.trilead.ssh2.Connection.connect(Connection.java:818)
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1324)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:831)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:820)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    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:93)
    at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
    at com.trilead.ssh2.Connection.connect(Connection.java:770)
    ... 7 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
    at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:405)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:777)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489)
    ... 1 more
[05/02/18 15:26:59] Launch failed - cleaning up connection
[05/02/18 15:26:59] [SSH] Connection closed.

Configuration for Node: - Start-Method: Start Slave over SSH - Hostname: is the IP - Access Data: user i created for SSH Access - > public key is in authorized keys on Slave Node

If i am on my Master as user "jenkins" and do a ssh jenkins@<IP> i can login wihtout problems (public key is on slave).

Why it doesn't work for "UI-Jenkins".

Jenkins-Version: 1.658

Node: Ubuntu 14.04

SSH-Slave Plugin: 1.26

Answer

Merowinger picture Merowinger · May 4, 2018

That "solved" the issue:

"Workaround is by commenting out MACs and KexAlgorithm line in /etc/ssh/sshd_config of Jenkins Slave and restarting the sshd (service ssh restart on Ubuntu)

UPDATE: the issue has been resolved as of 2017-04-29 "

Jenkins master fails to connect to the slave over SSH