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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ssh-credentials-plugin
    • Labels:
    • Environment:
      Jenkins v2.138.2
      ssh-credentials-plugin version 1.14
      ssh-slaves-plugin version 1.29.0
    • Similar Issues:
    • Released As:
      ssh-slaves-1.29.1

      Description

      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.

       

        Attachments

          Issue Links

            Activity

            Hide
            dnusbaum Devin Nusbaum added a comment -

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

            Show
            dnusbaum Devin Nusbaum added a comment - Based on this post by Ivan Fernandez Calvo , I think this should be fixed in the 1.29.1 release of ssh-slaves.
            Hide
            ifernandezcalvo 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

            Show
            ifernandezcalvo 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
            Hide
            zanettea arrigo zanette added a comment -

            I still see the issue with 1.29.1

            Show
            zanettea arrigo zanette added a comment - I still see the issue with 1.29.1
            Hide
            ifernandezcalvo 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
            
            Show
            ifernandezcalvo 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
            Hide
            zanettea arrigo zanette added a comment -

            I did fix it cleaning the plugin folder and reinstalling 1.29.1 from scratch. Now it works.

            Show
            zanettea arrigo zanette added a comment - I did fix it cleaning the plugin folder and reinstalling 1.29.1 from scratch. Now it works.
            Hide
            tomdev Tom de Vries added a comment -

            Yesterday I downgraded the plugin to 1.28.x. Today upgraded to 1.29.1 and that seems to be working fine!

            Show
            tomdev Tom de Vries added a comment - Yesterday I downgraded the plugin to 1.28.x. Today upgraded to 1.29.1 and that seems to be working fine!
            Hide
            dodoent Nenad Miksa added a comment -

            This resurfaces back in 1.29.2. Downgrading to 1.29.1 solves the issue for me.

            Show
            dodoent Nenad Miksa added a comment - This resurfaces back in 1.29.2. Downgrading to 1.29.1 solves the issue for me.
            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            if you upgrade from 1.29.X, you would have to uninstall trilead-api plugin is no longer used and it is the source of the classpath error

            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - if you upgrade from 1.29.X, you would have to uninstall trilead-api plugin is no longer used and it is the source of the classpath error
            Hide
            cowwoc cowwoc added a comment -

            Ivan Fernandez Calvo I don't have trilead-api plugin installed and yet I am getting this error in version 1.29.2 of this plugin. Please reopen this bug. It is not fixed.

            Show
            cowwoc cowwoc added a comment - Ivan Fernandez Calvo I don't have trilead-api plugin installed and yet I am getting this error in version 1.29.2 of this plugin. Please reopen this bug. It is not fixed.
            Hide
            cowwoc cowwoc added a comment -

            Nevermind. Upgrading to version 1.29.4 of this plugin fixes the problem. Thank you.

            Show
            cowwoc cowwoc added a comment - Nevermind. Upgrading to version 1.29.4 of this plugin fixes the problem. Thank you.

              People

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

                Dates

                Created:
                Updated:
                Resolved: