4
votes

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

3

3 Answers

4
votes

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

0
votes

Execute this command on destination node.

sudo -i su -c 'sed -i -e "s/MACs /MACs hmac-sha1,/g" /etc/ssh/sshd_config; service sshd restart'

0
votes

Thought I'd throw my experience in this thread: my environment had a Windows master and mixed Windows and Linux agents. One Windows agent refused to connect to master, even after Master pushed 'jenkins-agent' and the other supporting files to the agent.

This agent had 6 different versions of the JDK and JRE installed. I uninstalled all of them, reinstalled only the latest JDK we needed, and set JAVA_HOME. This fixed the connectivity issue.