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

SSH plugin fails intermittently because of issue with JSch

    XMLWordPrintable

Details

    Description

      This is similar to an earlier bug https://issues.jenkins-ci.org/browse/JENKINS-24402?jql=text%20~%20%22jsch%22

       

      Same problem has resurfaced in the later releases of JSch, because of that we get failed builds intermittently with the below error.

       

      JSch has included a fix for this problem in the latest version , v0.1.55.

      Upgrading Jenkins SSH plugin to this version should fix this problem.

       

      These discussion forums provide the context

      discussion about the issues in JSch and fix https://sourceforge.net/p/jsch/bugs/111/

      discussion about previous fix in Jenkins SSH plugin and further recurrences https://stackoverflow.com/questions/12279836/ssh-using-jschexception-verify-false-sometimes-fails

       

      Stacktrace:

      [SSH] executing...
      [SSH] Exception:Session.connect: java.security.SignatureException: Invalid encoding for signature
      com.jcraft.jsch.JSchException: Session.connect: java.security.SignatureException: Invalid encoding for signature
      at com.jcraft.jsch.Session.connect(Session.java:565)
      at org.jvnet.hudson.plugins.CredentialsSSHSite.createSession(CredentialsSSHSite.java:132)
      at org.jvnet.hudson.plugins.CredentialsSSHSite.executeCommand(CredentialsSSHSite.java:208)
      at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:104)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1798)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)

       

      Attachments

        Activity

          oleg_nenashev Oleg Nenashev added a comment -

          The plugin uses JSch plugin for Jenkins: https://github.com/jenkinsci/ssh-plugin/blob/master/pom.xml#L33 . Plugin page: https://plugins.jenkins.io/jsch . Version 0.1.55 is already available for this plugin. 

          Please update and report results

           

          oleg_nenashev Oleg Nenashev added a comment - The plugin uses JSch plugin for Jenkins: https://github.com/jenkinsci/ssh-plugin/blob/master/pom.xml#L33  . Plugin page: https://plugins.jenkins.io/jsch  . Version 0.1.55 is already available for this plugin.  Please update and report results  
          oleg_nenashev Oleg Nenashev added a comment -

          CC jvz and jthompson just in case I am missing something

          oleg_nenashev Oleg Nenashev added a comment - CC jvz and jthompson just in case I am missing something
          jvz Matt Sicker added a comment -

          Chances are that the old version of JSch was less restrictive about allowed key parameters and such. Do you have info about the server and client ciphers being used? Key sizes, algorithm choice, that sort of thing.

          jvz Matt Sicker added a comment - Chances are that the old version of JSch was less restrictive about allowed key parameters and such. Do you have info about the server and client ciphers being used? Key sizes, algorithm choice, that sort of thing.
          jthompson Jeff Thompson added a comment -

          Looks correct to me. The 0.1.55 version is available and looks like it may fix the problem. The ssh-plugin should be updated to use the new dependency version.

          jthompson Jeff Thompson added a comment - Looks correct to me. The 0.1.55 version is available and looks like it may fix the problem. The ssh-plugin should be updated to use the new dependency version.
          jvz Matt Sicker added a comment -

          But the jsch-plugin is already updated to JSCH 0.1.55. You made the release: https://github.com/jenkinsci/jsch-plugin/releases/tag/jsch-0.1.55

          jvz Matt Sicker added a comment - But the jsch-plugin is already updated to JSCH 0.1.55. You made the release: https://github.com/jenkinsci/jsch-plugin/releases/tag/jsch-0.1.55
          jthompson Jeff Thompson added a comment -

          jvz, right. I released the jsch-plugin 0.1.55 containing the fix the for this. The ssh-plugin should be updated to reference the new jsch-plugin version. kusumanchi might be able to update the jsch-plugin version and test it out.

          jthompson Jeff Thompson added a comment - jvz , right. I released the jsch-plugin 0.1.55 containing the fix the for this. The ssh-plugin should be updated to reference the new jsch-plugin version. kusumanchi might be able to update the jsch-plugin version and test it out.
          kusumanchi V Kusumanchi added a comment -

          jthompson, jvz I have updated the pom.xml with the reference to 0.1.55 version of jsch plugin.

          Raised a PR for the change, https://github.com/dev-medha-io/ssh-plugin/pull/1

          Could anyone merge this? Thanks

          kusumanchi V Kusumanchi added a comment - jthompson , jvz I have updated the pom.xml with the reference to 0.1.55 version of jsch plugin. Raised a PR for the change, https://github.com/dev-medha-io/ssh-plugin/pull/1 Could anyone merge this? Thanks
          jthompson Jeff Thompson added a comment -

          kusumanchi, I think you want to change your pull request to merge into the master branch on jenkinsci/ssh-plugin. Otherwise, it looks good.

          jthompson Jeff Thompson added a comment - kusumanchi , I think you want to change your pull request to merge into the master branch on jenkinsci/ssh-plugin. Otherwise, it looks good.
          kusumanchi V Kusumanchi added a comment -

          Thank you  jthompson, I created a new PR merging into jenkinsci/ssh-plugin.

          kindly have another look  https://github.com/jenkinsci/ssh-plugin/pull/18

          If you are happy, please merge it.

           

          kusumanchi V Kusumanchi added a comment - Thank you  jthompson , I created a new PR merging into jenkinsci/ssh-plugin. kindly have another look  https://github.com/jenkinsci/ssh-plugin/pull/18 If you are happy, please merge it.  

          People

            kusumanchi V Kusumanchi
            kusumanchi V Kusumanchi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: