[JIRA] (JENKINS-59676) `java.lang.ClassNotFoundException: org.kohsuke.putty.PuTTYKey` on scm step

24 views
Skip to first unread message

dicomj23@gmail.com (JIRA)

unread,
Oct 5, 2019, 6:09:12 AM10/5/19
to jenkinsc...@googlegroups.com
Dicom J created an issue
 
Jenkins / Bug JENKINS-59676
`java.lang.ClassNotFoundException: org.kohsuke.putty.PuTTYKey` on scm step
Issue Type: Bug Bug
Assignee: Ivan Fernandez Calvo
Components: trilead-api-plugin
Created: 2019-10-05 10:08
Environment: Jenkins Version 2.190.1

ace-editor:1.1 - [bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
allure-jenkins-plugin:2.28.1 - [script-security (1.25), matrix-project (1.11), structs (1.5) optional, workflow-step-api (2.4) optional, bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
apache-httpcomponents-client-4-api:4.5.10-1.0 - [trilead-api (1.0.4) optional]
authentication-tokens:1.3 - [credentials (1.22), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
bouncycastle-api:2.17 - [trilead-api (1.0.4) optional]
branch-api:2.5.4 - [cloudbees-folder (6.9), scm-api (2.4.1), structs (1.18), trilead-api (1.0.4) optional]
cloudbees-folder:6.9 - [credentials (2.1.11) optional, trilead-api (1.0.4) optional]
configuration-as-code-support:1.18 - [trilead-api (1.0.4) optional]
configuration-as-code:1.31 - [trilead-api (1.0.4) optional]
credentials-binding:1.20 - [workflow-step-api (2.20), credentials (2.2.0), plain-credentials (1.3), ssh-credentials (1.17.1), structs (1.19), trilead-api (1.0.4) optional]
credentials:2.3.0 - [structs (1.19), configuration-as-code (1.14) optional, trilead-api (1.0.4) optional]
display-url-api:2.3.2 - [trilead-api (1.0.4) optional]
docker-commons:1.15 - [authentication-tokens (1.3), credentials-binding (1.18), credentials (2.1.18), pipeline-model-extensions (1.3.8) optional, trilead-api (1.0.4) optional]
docker-workflow:1.19 - [workflow-api (2.8), workflow-basic-steps (2.3), workflow-cps (2.25), workflow-durable-task-step (2.8), workflow-step-api (2.18), workflow-support (2.12), docker-commons (1.14), script-security (1.25), trilead-api (1.0.4) optional]
durable-task:1.30 - [bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
filesystem_scm:2.1 - [structs (1.5), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
git-client:2.8.6 - [apache-httpcomponents-client-4-api (4.5.3-2.0), credentials (2.1.13), jsch (0.1.54.1), ssh-credentials (1.13), structs (1.9), trilead-api (1.0.4) optional]
git-server:1.8 - [git-client (2.7.6), trilead-api (1.0.4) optional]
git:3.12.1 - [workflow-scm-step (2.7), workflow-step-api (2.20), credentials (2.1.18), git-client (2.7.7), mailer (1.18), matrix-project (1.7.1), scm-api (2.6.3), ssh-credentials (1.13), structs (1.19), trilead-api (1.0.4) optional]
jackson2-api:2.9.10 - [trilead-api (1.0.4) optional]
jquery-detached:1.2.1 - [bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
jsch:0.1.55.1 - [ssh-credentials (1.14), trilead-api (1.0.4) optional]
junit:1.28 - [workflow-api (2.34), workflow-step-api (2.19), script-security (1.56), structs (1.17), trilead-api (1.0.4) optional]
mailer:1.29 - [display-url-api (2.3.1), trilead-api (1.0.4) optional]
matrix-project:1.14 - [junit (1.20), script-security (1.54), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
pipeline-input-step:2.11 - [workflow-api (2.35), workflow-step-api (2.20), workflow-support (3.3), credentials (2.3.0), trilead-api (1.0.4) optional]
pipeline-model-api:1.3.9 - [workflow-step-api (2.20), jackson2-api (2.9.8), structs (1.19), trilead-api (1.0.4) optional]
pipeline-model-declarative-agent:1.1.1 - [pipeline-model-extensions (1.1.1), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
pipeline-model-definition:1.3.9 - [workflow-api (2.34), workflow-basic-steps (2.18), workflow-cps-global-lib (2.9), workflow-cps (2.70), workflow-durable-task-step (2.31), workflow-multibranch (2.16), workflow-scm-step (2.6), workflow-support (3.3), credentials-binding (1.13), credentials (2.1.16), docker-workflow (1.14), git-client (2.7.0), mailer (1.20), pipeline-input-step (2.8), pipeline-stage-step (2.3), scm-api (2.2.7), pipeline-model-api (1.3.9), pipeline-model-declarative-agent (1.1.1), pipeline-model-extensions (1.3.9), pipeline-stage-tags-metadata (1.3.9), trilead-api (1.0.4) optional]
pipeline-model-extensions:1.3.9 - [workflow-cps (2.70), workflow-job (2.26), credentials-binding (1.13), credentials (2.1.16), pipeline-stage-step (2.3), pipeline-model-api (1.3.9), trilead-api (1.0.4) optional]
pipeline-stage-step:2.3 - [workflow-api (2.15), workflow-step-api (2.11), scm-api (2.0.7), structs (1.6), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
pipeline-stage-tags-metadata:1.3.9 - [workflow-api (2.34), trilead-api (1.0.4) optional]
pipeline-utility-steps:2.3.1 - [workflow-api (2.31), workflow-step-api (2.19), scm-api (2.2.6), script-security (1.46), structs (1.17), workflow-cps (2.58) optional, trilead-api (1.0.4) optional]
plain-credentials:1.5 - [credentials (2.1.16), trilead-api (1.0.4) optional]
resource-disposer:0.13 - [trilead-api (1.0.4) optional]
scm-api:2.6.3 - [structs (1.9), trilead-api (1.0.4) optional]
script-security:1.66 - [trilead-api (1.0.4) optional]
ssh-agent:1.17 - [workflow-step-api (2.16), bouncycastle-api (2.16.3), credentials (2.1.17), ssh-credentials (1.14), trilead-api (1.0.4) optional]
ssh-credentials:1.17.3 - [credentials (2.2.0), trilead-api (1.0.4) optional]
ssh-steps:2.0.0 - [workflow-step-api (2.19), trilead-api (1.0.4) optional]
structs:1.20 - [trilead-api (1.0.4) optional]
trilead-api:1.0.5 - []
workflow-api:2.37 - [workflow-step-api (2.16), scm-api (2.2.6), structs (1.17), trilead-api (1.0.4) optional]
workflow-basic-steps:2.18 - [workflow-api (2.34), workflow-durable-task-step (2.31), workflow-step-api (2.20), apache-httpcomponents-client-4-api (4.5.5-3.0), mailer (1.18), structs (1.18), trilead-api (1.0.4) optional]
workflow-cps-global-lib:2.15 - [workflow-api (2.33), workflow-cps (2.71), workflow-scm-step (2.7), workflow-step-api (2.20), workflow-support (3.3), cloudbees-folder (6.1.2), credentials (2.1.18), git-server (1.7), scm-api (2.6.3), script-security (1.60), structs (1.19), trilead-api (1.0.4) optional]
workflow-cps:2.74 - [workflow-api (2.36), workflow-scm-step (2.4), workflow-step-api (2.20), workflow-support (3.3), scm-api (2.2.6), script-security (1.62), structs (1.20), ace-editor (1.0.1), jquery-detached (1.2.1), trilead-api (1.0.4) optional]
workflow-durable-task-step:2.34 - [workflow-api (2.33), workflow-step-api (2.20), workflow-support (3.3), durable-task (1.29), scm-api (2.2.6), script-security (1.58), structs (1.18), trilead-api (1.0.4) optional]
workflow-job:2.35 - [workflow-api (2.36), workflow-step-api (2.20), workflow-support (3.3), trilead-api (1.0.4) optional]
workflow-multibranch:2.21 - [workflow-api (2.27), workflow-cps (2.53), workflow-job (2.21), workflow-scm-step (2.4), workflow-step-api (2.13), workflow-support (2.17), branch-api (2.0.21), cloudbees-folder (6.1.2), scm-api (2.2.7), script-security (1.42), structs (1.17), trilead-api (1.0.4) optional]
workflow-scm-step:2.9 - [workflow-step-api (2.9), trilead-api (1.0.4) optional]
workflow-step-api:2.20 - [structs (1.18), trilead-api (1.0.4) optional]
workflow-support:3.3 - [workflow-api (2.30), workflow-step-api (2.19), scm-api (2.2.6), script-security (1.39), trilead-api (1.0.4) optional]
ws-cleanup:0.37 - [workflow-durable-task-step (2.4), matrix-project (1.7.1), resource-disposer (0.3), script-security (1.18.1), structs (1.5), bouncycastle-api (2.16.0) optional, trilead-api (1.0.4) optional]
Priority: Minor Minor
Reporter: Dicom J

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 
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kuisathaverat@gmail.com (JIRA)

unread,
Oct 6, 2019, 6:50:03 AM10/6/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 7:50:04 AM10/6/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-59676
 
Re: `java.lang.ClassNotFoundException: org.kohsuke.putty.PuTTYKey` on scm step

If you're willing to try a pre-release build, you could install the build from PR-467 which includes a dependency on trlead-api. That build is only temporary, but it is being discussed in the pull request as a possible solution.

dicomj23@gmail.com (JIRA)

unread,
Oct 6, 2019, 8:04:03 AM10/6/19
to jenkinsc...@googlegroups.com
Dicom J commented on Bug JENKINS-59676

Mark Waite, this "pre-release" build (I hope you meant plugin) is installed as the "latest" along with Jenkins Version 2.190.1, which appears on LTS list https://jenkins.io/changelog-stable/...

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 8:30:02 AM10/6/19
to jenkinsc...@googlegroups.com

Yes, Dicom J the pre-release build (pull request build) is a build of the git client plugin from the stable-2.x branch, with the addition of a dependency on the trilead-api plugin. Install it on the Jenkins server where you are seeing this error, then report to this bug report if the error is resolved. If you're uncomfortable remaining with that pull request build, you can uninstall that version and return to the previous version after the experiment is complete.

kuisathaverat@gmail.com (JIRA)

unread,
Oct 6, 2019, 8:42:02 AM10/6/19
to jenkinsc...@googlegroups.com

I've tested a fresh installation of Jenkins 2.190.1, I've used a docker-compose environment you can find at https://github.com/kuisathaverat/jenkins-issues/tree/master/JENKINS-59676 , I cannot replicate the issue, the trilead-api 1.04 is installed and everything works as expected.
Did you make a fresh install or an update from a previous version?

dicomj23@gmail.com (JIRA)

unread,
Oct 6, 2019, 8:45:03 AM10/6/19
to jenkinsc...@googlegroups.com
Dicom J commented on Bug JENKINS-59676

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 wast 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 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.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 1:37:03 PM10/6/19
to jenkinsc...@googlegroups.com

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.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 1:42:03 PM10/6/19
to jenkinsc...@googlegroups.com

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?

dicomj23@gmail.com (JIRA)

unread,
Oct 6, 2019, 1:43:02 PM10/6/19
to jenkinsc...@googlegroups.com

dicomj23@gmail.com (JIRA)

unread,
Oct 6, 2019, 1:46:02 PM10/6/19
to jenkinsc...@googlegroups.com
Dicom J edited a comment on Bug JENKINS-59676
[~markewaite], 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 wast 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.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 20, 2019, 6:36:03 AM10/20/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
If the trilead-api plugin is not installed on a Jenkins 2.190.1 server, results in the following stacktrace
{code:java}

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 {code}

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.
Reply all
Reply to author
Forward
0 new messages