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

ssh-credentials-plugin broken when using ssh-slaves-plugin 1.29.0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ssh-credentials-plugin
    • Jenkins v2.138.2
      ssh-credentials-plugin version 1.14
      ssh-slaves-plugin version 1.29.0
    • ssh-slaves-1.29.1

      Jenkins fails to launch agents when using the following combination of plugins:

      • ssh-credentials-plugin version 1.14
      • ssh-slaves-plugin version 1.29.0

      This results in the following error:

      SSHLauncher{host='jenkins-worker.example.com', port=22, credentialsId='bc123fc4-0123-4123-9123-81230e2d0e4d', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=80, retryWaitTime=15, sshHostKeyVerificationStrategy=None, tcpNoDelay=true, trackCredentials=true}
      [11/20/18 10:47:48] [SSH] Opening SSH connection to jenkins-worker.example.com:22.
      [11/20/18 10:47:49] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
      ERROR: Unexpected error in launching a agent. This is probably a bug in Jenkins.
      java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection
        at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.supports(TrileadSSHPasswordAuthenticator.java:194)
        at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.newInstance(TrileadSSHPasswordAuthenticator.java:181)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:216)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:170)
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1213)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:846)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:833)
        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)
      [11/20/18 10:47:50] Launch failed - cleaning up connection
      [11/20/18 10:47:50] [SSH] Connection closed.

      Cause

      This issue is caused by the ssh-slaves-plugin not longer using the trilead-ssh2 module from the Jenkins core. However, ssh-credentials-plugin still requires this. See: https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md#1290-breaks-compatibility-with-cloud-plugins-that-do-not-use-trilead-api-plugin-as-dependency

      Workaround

      Current workaround is to downgrade the ssh-slaves-plugin to version 1.28.1.

       

          [JENKINS-54724] ssh-credentials-plugin broken when using ssh-slaves-plugin 1.29.0

          Tom de Vries created issue -

          Devin Nusbaum added a comment -

          Based on this post by ifernandezcalvo, I think this should be fixed in the 1.29.1 release of ssh-slaves.

          Devin Nusbaum added a comment - Based on this post by ifernandezcalvo , I think this should be fixed in the 1.29.1 release of ssh-slaves.
          Devin Nusbaum made changes -
          Assignee Original: Devin Nusbaum [ dnusbaum ] New: Ivan Fernandez Calvo [ ifernandezcalvo ]
          Devin Nusbaum made changes -
          Link New: This issue is duplicated by JENKINS-54709 [ JENKINS-54709 ]
          Devin Nusbaum made changes -
          Link New: This issue relates to JENKINS-54686 [ JENKINS-54686 ]

          Ivan Fernandez Calvo added a comment - - edited

          yep, it is caused by JENKINS-54686, I have fixed it this morning on ssh-slaves 1.29.1

          Ivan Fernandez Calvo added a comment - - edited yep, it is caused by JENKINS-54686 , I have fixed it this morning on ssh-slaves 1.29.1
          Ivan Fernandez Calvo made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          I still see the issue with 1.29.1

          arrigo zanette added a comment - I still see the issue with 1.29.1

          Could you please execute the following script in your Jenkins console and attach the result? it will generate the list of installed plugins, this will allow me to try to replicate the issue.

          result = ''
          for (plugin in Jenkins.instance.pluginManager.plugins) {
          	result = result + "${plugin.displayName}" + ',' + "${plugin.version}\n"
          }
          return result
          

          Ivan Fernandez Calvo added a comment - Could you please execute the following script in your Jenkins console and attach the result? it will generate the list of installed plugins, this will allow me to try to replicate the issue. result = '' for (plugin in Jenkins.instance.pluginManager.plugins) { result = result + "${plugin.displayName}" + ',' + "${plugin.version}\n" } return result
          Ivan Fernandez Calvo made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

            ifernandezcalvo Ivan Fernandez Calvo
            tomdev Tom de Vries
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: