jenkinsci / jenkinsci/ssh-credentials-plugin

[JENKINS-29647] java.lang.NoClassDefFoundError thrown by jenkins slave while the class is in the class path.

Open
#289 10 comments 0 reactions 0 assignees View on GitHub
component:ssh-credentials-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
25
Forks
69
PR merge metrics
No merged PRs in 30d

Description

0. Jenkins slave run for couple days.

1. Git fetches failed one day suddenly.

2. Complaint Putty class java.lang.NoClassDefFoundError. although it exists under ~/.jenkins/cache/jars in that slave.

I assume the jenkins cache is messed up somehow or at least slave process suddenly has wrong memory of whats in the cache.

so I did below test.

1. disconnect the jenkins slave to kill slave java process.

2. rm -rf ~/.jenkins/cache/jars.

3. bring jenkins slave back online(launche method ssh)

4. I did see the ~/.jenkins/cache/jars filled with jars. but it does not include

PuTTYKey and it does not even include class JavaVMArguments.class.

5. if manually copied jar files in another functional jenkins slave to the cache and re-launche agent, those jars/classes still cant be recognized by slave java process.

Note: the master jvm uses jdk1.7.75, the slave uses jdk1.7.79.

12:42:12 - ERROR: Error fetching remote repo 'origin'

12:42:12 - hudson.plugins.git.GitException: Failed to fetch from git@​XXX:YYY.git

12:42:12 - at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)

12:42:12 - at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)

12:42:12 - at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)

12:42:12 - at hudson.scm.SCM.checkout(SCM.java:488)

12:42:12 - at hudson.model.AbstractProject.checkout(AbstractProject.java:1257)

12:42:12 - at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)

12:42:12 - at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)

12:42:12 - at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)

12:42:12 - at hudson.model.Run.execute(Run.java:1745)

12:42:12 - at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)

12:42:12 - at hudson.model.ResourceController.execute(ResourceController.java:89)

12:42:12 - at hudson.model.Executor.run(Executor.java:240)

12:42:12 - Caused by: hudson.plugins.git.GitException: java.io.IOException: Remote call on a004999.com failed

12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:172)

12:42:12 - at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)

12:42:12 - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

12:42:12 - at java.lang.reflect.Method.invoke(Method.java:606)

12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)

12:42:12 - at com.sun.proxy.$Proxy48.execute(Unknown Source)

12:42:12 - at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:733)

12:42:12 - ... 11 more

12:42:12 - Caused by: java.io.IOException: Remote call on a004999.com failed

12:42:12 - at hudson.remoting.Channel.call(Channel.java:760)

12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)

12:42:12 - ... 17 more

12:42:12 - Caused by: java.lang.NoClassDefFoundError: org/kohsuke/putty/PuTTYKey

12:42:12 - at com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey.getPrivateKeys(BasicSSHUserPrivateKey.java:132)

12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.createSshKeyFile(CliGitAPIImpl.java:1417)

12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1295)

12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)

12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)

12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)

12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)

12:42:12 - at hudson.remoting.UserRequest.perform(UserRequest.java:121)

12:42:12 - at hudson.remoting.UserRequest.perform(UserRequest.java:49)

12:42:12 - at hudson.remoting.Request$2.run(Request.java:324)

12:42:12 - at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)

12:42:12 - at java.util.concurrent.FutureTask.run(FutureTask.java:262)

12:42:12 - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

12:42:12 - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

12:42:12 - at java.lang.Thread.run(Thread.java:745)

12:42:12 - at ......remote call to a004999.com(Native Method)

12:42:12 - at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)

12:42:12 - at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)

12:42:12 - at hudson.remoting.Channel.call(Channel.java:752)

12:42:12 - ... 18 more

12:42:12 - ERROR: Error fetching remote repo 'origin'

12:42:12 - Recording test results

---
Originally reported by eshen, imported from: java.lang.NoClassDefFoundError thrown by jenkins slave while the class is in the class path.


  • status: Open
  • priority: Blocker
  • component(s): ssh-credentials-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 5
  • imported: 20251215-193512

Raw content of original issue

0. Jenkins slave run for couple days.
1. Git fetches failed one day suddenly.
2. Complaint Putty class java.lang.NoClassDefFoundError. although it exists under ~/.jenkins/cache/jars in that slave.

I assume the jenkins cache is messed up somehow or at least slave process suddenly has wrong memory of whats in the cache.
so I did below test.
1. disconnect the jenkins slave to kill slave java process.
2. rm -rf ~/.jenkins/cache/jars.
3. bring jenkins slave back online(launche method ssh)
4. I did see the ~/.jenkins/cache/jars filled with jars. but it does not include
PuTTYKey and it does not even include class JavaVMArguments.class.
5. if manually copied jar files in another functional jenkins slave to the cache and re-launche agent, those jars/classes still cant be recognized by slave java process.

Note: the master jvm uses jdk1.7.75, the slave uses jdk1.7.79.

12:42:12 - ERROR: Error fetching remote repo 'origin'
12:42:12 - hudson.plugins.git.GitException: Failed to fetch from git@XXX:YYY.git
12:42:12 - at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)
12:42:12 - at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)
12:42:12 - at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)
12:42:12 - at hudson.scm.SCM.checkout(SCM.java:488)
12:42:12 - at hudson.model.AbstractProject.checkout(AbstractProject.java:1257)
12:42:12 - at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
12:42:12 - at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
12:42:12 - at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
12:42:12 - at hudson.model.Run.execute(Run.java:1745)
12:42:12 - at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
12:42:12 - at hudson.model.ResourceController.execute(ResourceController.java:89)
12:42:12 - at hudson.model.Executor.run(Executor.java:240)
12:42:12 - Caused by: hudson.plugins.git.GitException: java.io.IOException: Remote call on a004999.com failed
12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:172)
12:42:12 - at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
12:42:12 - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:42:12 - at java.lang.reflect.Method.invoke(Method.java:606)
12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
12:42:12 - at com.sun.proxy.$Proxy48.execute(Unknown Source)
12:42:12 - at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:733)
12:42:12 - ... 11 more
12:42:12 - Caused by: java.io.IOException: Remote call on a004999.com failed
12:42:12 - at hudson.remoting.Channel.call(Channel.java:760)
12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
12:42:12 - ... 17 more
12:42:12 - Caused by: java.lang.NoClassDefFoundError: org/kohsuke/putty/PuTTYKey
12:42:12 - at com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey.getPrivateKeys(BasicSSHUserPrivateKey.java:132)
12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.createSshKeyFile(CliGitAPIImpl.java:1417)
12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1295)
12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
12:42:12 - at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
12:42:12 - at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
12:42:12 - at hudson.remoting.UserRequest.perform(UserRequest.java:121)
12:42:12 - at hudson.remoting.UserRequest.perform(UserRequest.java:49)
12:42:12 - at hudson.remoting.Request$2.run(Request.java:324)
12:42:12 - at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
12:42:12 - at java.util.concurrent.FutureTask.run(FutureTask.java:262)
12:42:12 - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
12:42:12 - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
12:42:12 - at java.lang.Thread.run(Thread.java:745)
12:42:12 - at ......remote call to a004999.com(Native Method)
12:42:12 - at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
12:42:12 - at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
12:42:12 - at hudson.remoting.Channel.call(Channel.java:752)
12:42:12 - ... 18 more
12:42:12 - ERROR: Error fetching remote repo 'origin'
12:42:12 - Recording test results

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.