Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43986

Ubuntu slave cannot be started because ssh connection fails

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: ssh-slaves-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008 R2 Standard SP1
      Jenkins ver. 2.46.2
    • Similar Issues:

      Description

      The SSH connection with the Ubuntu server fails with the error message "Key exchange was not finished, connection is closed.".

      [05/02/17 13:07:48] [SSH] Opening SSH connection to 172.16.11.242:22.
      C:\Windows\system32\config\systemprofile\.ssh\known_hosts [SSH] No Known Hosts file was found at C:\Windows\system32\config\systemprofile\.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.16.11.242:22
          at com.trilead.ssh2.Connection.connect(Connection.java:818)
          at com.trilead.ssh2.Connection.connect(Connection.java:687)
          at com.trilead.ssh2.Connection.connect(Connection.java:601)
          at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1265)
          at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:790)
          at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:785)
          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)
      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)
          ... 9 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:591)
          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/17 13:07:48] Launch failed - cleaning up connection
      [05/02/17 13:07:48] [SSH] Connection closed.

      The slave is configured to connect and authenticate with username and password.

      There is also a warning about a missing ssh known_hosts file (No Known Hosts file was found at C:\Windows\system32\config\systemprofile\.ssh\known_hosts. Please ensure one is created at this path and that Jenkins can read it.), but in windows it is not possible to create a folder with a name starting with a point (.ssh)

       

       

        Attachments

          Issue Links

            Activity

            Hide
            peppe Giuseppe Landolfi added a comment -

            Hi,

            you can try to create the ".ssh" folder: it is possible.

             

            Peppe

            Show
            peppe Giuseppe Landolfi added a comment - Hi, you can try to create the ".ssh" folder: it is possible .   Peppe
            Hide
            paladox paladox added a comment -

            Hi, you log in as Jenkins on the host then try ssh into the slave from the host you want ssh slaves to connect to

            Show
            paladox paladox added a comment - Hi, you log in as Jenkins on the host then try ssh into the slave from the host you want ssh slaves to connect to
            Hide
            tfrearson Thomas Frearson added a comment - - edited

            Not really the issue, I think the known_hosts file would actually be on the Master. it isn't though, so maybe this is a real issue I'm having. One slave is good, the others are not.

            One of the issues here, is the path that the Master is looking for the key at, C:\Windows\system32\config\systemprofile\.ssh\known_hosts. These are Ubuntu VMs, there is not C:\Windows\System32 on these systems. This has been an issue for me also since upgrading this plugin. I'll keep reading through issues and see if I can find a resolution.

            Show
            tfrearson Thomas Frearson added a comment - - edited Not really the issue, I think the known_hosts file would actually be on the Master. it isn't though, so maybe this is a real issue I'm having. One slave is good, the others are not. One of the issues here, is the path that the Master is looking for the key at, C:\Windows\system32\config\systemprofile\.ssh\known_hosts. These are Ubuntu VMs, there is not C:\Windows\System32 on these systems . This has been an issue for me also since upgrading this plugin. I'll keep reading through issues and see if I can find a resolution.
            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            You must import the public key of the Agent, in the know host on the Jenkins instance (in your case C:\Windows\system32\config\systemprofile\.ssh\known_hosts) if you do not do that you cannot verify the host key.

            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - You must import the public key of the Agent, in the know host on the Jenkins instance (in your case C:\Windows\system32\config\systemprofile\.ssh\known_hosts) if you do not do that you cannot verify the host key.

              People

              • Assignee:
                peppe Giuseppe Landolfi
                Reporter:
                spamme spam me
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: