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

`java.lang.ClassNotFoundException: org.kohsuke.putty.PuTTYKey` on scm step

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
    • Similar Issues:
    • Released As:
      Git client plugin 3.3.0 released June 19, 2020

      Description

      If the trilead-api plugin is not installed on a Jenkins 2.190.1 server, results in the following stacktrace

      java.lang.ClassNotFoundException: org.kohsuke.putty.PuTTYKey
              at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1383)
              at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1336)
              at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1083)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      Caused: java.lang.NoClassDefFoundError: org/kohsuke/putty/PuTTYKey
              at com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey.getPrivateKeys(BasicSSHUserPrivateKey.java:174)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.createSshKeyFile(CliGitAPIImpl.java:1878)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1793)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:545)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:758)
              at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
              at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
              at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor 

      Workaround is to install the trilead-api plugin. The plugin was unbundled from Jenkins core in Jenkins 2.190.1 and is needed by those plugins (git client, ssh-slaves, etc.) that previously used the version that was bundled with Jenkins core.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Made the trilead dependency explicit and depend on Jenkins version 2.204.1 so that all the versions supported by this release have the trilead plugin unbunbled.

          Show
          markewaite Mark Waite added a comment - Made the trilead dependency explicit and depend on Jenkins version 2.204.1 so that all the versions supported by this release have the trilead plugin unbunbled.
          Hide
          dicomj23 Dicom J added a comment -

          Installed to resolve the problem

          Show
          dicomj23 Dicom J added a comment - Installed to resolve the problem
          Hide
          markewaite Mark Waite added a comment -

          Dicom J just to confirm, when you saw the problem, was trilead-api 1.0.5 already installed or did you install it to resolve the problem?

          Show
          markewaite Mark Waite added a comment - Dicom J just to confirm, when you saw the problem, was trilead-api 1.0.5 already installed or did you install it to resolve the problem?
          Hide
          markewaite Mark Waite added a comment -

          That is very good information Dicom J. You found the problem because the plugins in your installation had the trilead-api as an optional dependency which was not installed. I guess that means that when Jenkins 2.190.1 unbundled the trilead-api the API was removed from Jenkins core so that it would be in the trilead-api plugin.

          Ivan Fernandez Calvo and I probably both always include the trilead-api in our installations because at various times it has been required in different iterations of the releases of the various plugins that we use.

          I'm delighted that installing the trilead plugin resolved the issue. That makes me wonder if I should make it an explicit dependency in the git client plugin so that it will be automatically installed if not already installed by the user for other reasons.

          Show
          markewaite Mark Waite added a comment - That is very good information Dicom J . You found the problem because the plugins in your installation had the trilead-api as an optional dependency which was not installed. I guess that means that when Jenkins 2.190.1 unbundled the trilead-api the API was removed from Jenkins core so that it would be in the trilead-api plugin. Ivan Fernandez Calvo and I probably both always include the trilead-api in our installations because at various times it has been required in different iterations of the releases of the various plugins that we use. I'm delighted that installing the trilead plugin resolved the issue. That makes me wonder if I should make it an explicit dependency in the git client plugin so that it will be automatically installed if not already installed by the user for other reasons.
          Hide
          dicomj23 Dicom J added a comment - - edited

          Mark Waite, thanks, I'm fine  as I figured out it right away that explicitly adding trilead-api plugin would resolve the issues. the one you see in Environment section is "trilead-api:1.0.5 - []" is my explicit addition to the latest, git-client and the rest plugins depend on "trilead-api (1.0.4) optional" what it's optional dependency and was not installed in my case.
          So I run into this when I did everything from stretch and "by the book" rom GA repos, without adding "trilead-api" as I din't even know about it and none of the plugins installed it. So if I ran into this, there's a chance that somebody else would. So I just decided to let you guys know. That's it.

          Show
          dicomj23 Dicom J added a comment - - edited Mark Waite , thanks, I'm fine  as I figured out it right away that explicitly adding trilead-api plugin would resolve the issues. the one you see in Environment section is "trilead-api:1.0.5 - []" is my explicit addition to the latest, git-client and the rest plugins depend on "trilead-api (1.0.4) optional" what it's optional dependency and was not installed in my case. So I run into this when I did everything from stretch and "by the book" rom GA repos, without adding "trilead-api" as I din't even know about it and none of the plugins installed it. So if I ran into this, there's a chance that somebody else would. So I just decided to let you guys know. That's it.

            People

            • Assignee:
              markewaite Mark Waite
              Reporter:
              dicomj23 Dicom J
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: