[JIRA] (JENKINS-50019) java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins$MasterComputer

127 views
Skip to first unread message

ezyang@mit.edu (JIRA)

unread,
Mar 8, 2018, 10:02:04 AM3/8/18
to jenkinsc...@googlegroups.com
Edward Yang created an issue
 
Jenkins / Bug JENKINS-50019
java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins$MasterComputer
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2018-03-08 15:01
Environment: Jenkins 2.89.4, stock Ubuntu 16.04 Xenial
Priority: Major Major
Reporter: Edward Yang

We intermittently see nodes fail during Git checkout with a traceback that looks like this:

 
09:45:25 java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins$MasterComputer*09:45:25* at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)09:45:25 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)09:45:25 at jdk.internal.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)09:45:25 at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)09:45:25 at java.lang.reflect.Method.invoke(Method.java:564)09:45:25 at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:922)09:45:25 at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:896)09:45:25 at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)09:45:25 at hudson.remoting.UserRequest.perform(UserRequest.java:207)09:45:25 at hudson.remoting.UserRequest.perform(UserRequest.java:53)09:45:25 at hudson.remoting.Request$2.run(Request.java:358)09:45:25 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)09:45:25 at java.util.concurrent.FutureTask.run(FutureTask.java:264)09:45:25 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)09:45:25 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)09:45:25 at hudson.remoting.Engine$1$1.run(Engine.java:98)09:45:25 at java.lang.Thread.run(Thread.java:844)
Full log: https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-macos-10.13-py3-build-test/2797//console

Retrying does not resolve the problem, however, subsequent builds on the same node often do succeed (for the case above, three hours later another build succeeded.)

The error is highly reminiscent of https://issues.jenkins-ci.org/browse/JENKINS-19453 but that issue was fixed in the Jenkins 1.x series, and this is a much more modern version of Jenkins. Additionally, the error doesn't seem to be persistent (in that it's not necessary to restart the worker to resolve the problem.)

BTW, this is not just an OS X slave problem; we've had it happen to Linux workers too (although the missing class is different): https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-linux-trusty-py2.7.9-build/3214/console

I'm not really sure how to go about making a reproducing test case. Let me know if you have any ideas.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Mar 14, 2018, 6:58:04 AM3/14/18
to jenkinsc...@googlegroups.com

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

unread,
Mar 15, 2018, 8:20:03 AM3/15/18
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
We intermittently see nodes fail during Git checkout with a traceback that looks like this:

{noformat}  
*09:45:25* java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins$MasterComputer

*09:45:25*  at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
*09:45:25*  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
*09:45:25*  at jdk.internal.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
*09:45:25*  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
*09:45:25*  at java.lang.reflect.Method.invoke(Method.java:564)
*09:45:25*  at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:922)
*09:45:25*  at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:896)
*09:45:25*  at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)
*09:45:25*  at hudson.remoting.UserRequest.perform(UserRequest.java:207)
*09:45:25*  at hudson.remoting.UserRequest.perform(UserRequest.java:53)
*09:45:25*  at hudson.remoting.Request$2.run(Request.java:358)
*09:45:25*  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
*09:45:25*  at java.util.concurrent.FutureTask.run(FutureTask.java:264)
*09:45:25*  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
*09:45:25*  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
*09:45:25*  at hudson.remoting.Engine$1$1.run(Engine.java:98)
*09:45:25*  at java.lang.Thread.run(Thread.java:844)
Full log: [https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-macos-10.13-py3-build-test/2797//console]
{noformat}

Retrying does not resolve the problem, however, subsequent builds on the same node often do succeed (for the case above, three hours later another build succeeded.)

The error is highly reminiscent of https://issues.jenkins-ci.org/browse/JENKINS-19453 but that issue was fixed in the Jenkins 1.x series, and this is a much more modern version of Jenkins. Additionally, the error doesn't seem to be persistent (in that it's not necessary to restart the worker to resolve the problem.)

BTW, this is not just an OS X slave problem; we've had it happen to Linux workers too (although the missing class is different): [https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-linux-trusty-py2.7.9-build/3214/console]

I'm not really sure how to go about making a reproducing test case. Let me know if you have any ideas.

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

unread,
Mar 15, 2018, 8:22:02 AM3/15/18
to jenkinsc...@googlegroups.com


The other case stack trace looks like this:

{noformat}
23:28:29 Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from ip-172-31-82-71.ec2.internal/172.31.82.71:42464
23:28:29   at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
23:28:29   at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
23:28:29   at hudson.remoting.Channel.call(Channel.java:908)
23:28:29   at hudson.FilePath.act(FilePath.java:986)
23:28:29   at hudson.FilePath.act(FilePath.java:975)
23:28:29   at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:137)
23:28:29   at hudson.plugins.git.GitSCM.createClient(GitSCM.java:758)
23:28:29   at hudson.plugins.git.GitSCM.createClient(GitSCM.java:749)
23:28:29   at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1117)
23:28:29   at hudson.scm.SCM.checkout(SCM.java:495)
23:28:29   at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
23:28:29   at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
23:28:29   at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
23:28:29   at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
23:28:29   at hudson.model.Run.execute(Run.java:1724)
23:28:29   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
23:28:29   at hudson.model.ResourceController.execute(ResourceController.java:97)
23:28:29   at hudson.model.Executor.run(Executor.java:429)
23:28:29 java.lang.NoClassDefFoundError: Could not initialize class com.sun.proxy.$Proxy10
23:28:29  at sun.reflect.GeneratedConstructorAccessor16.newInstance(Unknown Source)
23:28:29  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
23:28:29  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
23:28:29  at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
23:28:29  at hudson.remoting.RemoteInvocationHandler.wrap(RemoteInvocationHandler.java:165)
23:28:29  at hudson.remoting.Channel.export(Channel.java:722)
23:28:29  at hudson.remoting.Channel.export(Channel.java:686)
23:28:29  at org.jenkinsci.plugins.gitclient.LegacyCompatibleGitAPIImpl.writeReplace(LegacyCompatibleGitAPIImpl.java:198)
23:28:29  at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
23:28:29  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
23:28:29  at java.lang.reflect.Method.invoke(Method.java:498)
23:28:29  at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:1218)
23:28:29  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1136)
23:28:29  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
23:28:29  at hudson.remoting.UserRequest._serialize(UserRequest.java:250)
23:28:29  at hudson.remoting.UserRequest.serialize(UserRequest.java:259)
23:28:29  at hudson.remoting.UserRequest.perform(UserRequest.java:221)
23:28:29  at hudson.remoting.UserRequest.perform(UserRequest.java:53)
23:28:29  at hudson.remoting.Request$2.run(Request.java:358)
23:28:29  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
23:28:29  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
23:28:29  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
23:28:29  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
23:28:29  at hudson.remoting.Engine$1$1.run(Engine.java:94)
23:28:29  at java.lang.Thread.run(Thread.java:748)
23:28:29 Caused: java.io.IOException: Remote call on JNLP4-connect connection from ip-172-31-82-71.ec2.internal/172.31.82.71:42464 failed
23:28:29  at hudson.remoting.Channel.call(Channel.java:916)
23:28:29  at hudson.FilePath.act(FilePath.java:986)
23:28:29 Caused: java.io.IOException: remote file operation failed: /var/lib/jenkins/workspace/pytorch-builds/pytorch-linux-trusty-py2.7.9-build at hudson.remoting.Channel@54638415:JNLP4-connect connection from ip-172-31-82-71.ec2.internal/172.31.82.71:42464
23:28:29  at hudson.FilePath.act(FilePath.java:993)
23:28:29  at hudson.FilePath.act(FilePath.java:975)
23:28:29  at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:137)
23:28:29  at hudson.plugins.git.GitSCM.createClient(GitSCM.java:758)
23:28:29  at hudson.plugins.git.GitSCM.createClient(GitSCM.java:749)
23:28:29  at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1117)
23:28:29  at hudson.scm.SCM.checkout(SCM.java:495)
23:28:29  at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
23:28:29  at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
23:28:29  at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
23:28:29  at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
23:28:29  at hudson.model.Run.execute(Run.java:1724)
23:28:29  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
23:28:29  at hudson.model.ResourceController.execute(ResourceController.java:97)
23:28:29  at hudson.model.Executor.run(Executor.java:429)
{noformat}

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

unread,
Mar 15, 2018, 8:29:01 AM3/15/18
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-50019
 
Re: java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins$MasterComputer

What version of Java is running on the agents which report that failure? JENKINS-49402 hints that a similar stack trace is seen when running a Java 1.8.0_111 on macOS. Since that version was released in late 2016, I assume there may be fixes in the newer Java versions which are not available in Java 1.8.0_111.

ezyang@mit.edu (JIRA)

unread,
Mar 17, 2018, 12:22:02 AM3/17/18
to jenkinsc...@googlegroups.com

The agents run a variety of different configurations, but this particular failure https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-win-ws2016-cuda9-cudnn7-py3-build/3541//console occurred on a Windows machine whose Java was installed via choco. This Java is jdk1.8.0_162 from https://chocolatey.org/packages/jdk8

In comparison, the server is running stock openjdk version "1.8.0_151" from Ubuntu Xenial.

I can try to dig up other versions if that would be helpful.

ezyang@mit.edu (JIRA)

unread,
Mar 17, 2018, 2:29:02 PM3/17/18
to jenkinsc...@googlegroups.com

Reading through the remoting code, it seems like the problem is that we're sending an RPC for, e.g., the class com.sun.proxy.$Proxy10, but since this is a dynamically allocated class, of course the other JVM instance is not going to appear. So it's likely a bug in whoever using the remoting code.

 

esmadsen@gnresound.com (JIRA)

unread,
Mar 27, 2018, 6:25:02 AM3/27/18
to jenkinsc...@googlegroups.com

We have just seen the same issue on one specific slave after an IT update caused the machine to restart. The node is running windows 7, Java 1.8.0_161 (32 bit), and this paticular one is started with web start. The node has been failing for several days (since the udate + reset). Restarting the slave seems to have fixed it for now.

victorvoronin@mail.ru (JIRA)

unread,
Jul 5, 2018, 8:59:02 AM7/5/18
to jenkinsc...@googlegroups.com

We have just faced with the same issue not once on Openshift running slave. The last was slave running CentOS Linux release 7.4.1708, Java 1.8.0_161 (64 bit). Restarting the slave fixes this issue usually. 

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

ezyang@mit.edu (JIRA)

unread,
Aug 29, 2018, 11:30:03 PM8/29/18
to jenkinsc...@googlegroups.com

So, with bugs like this, it is always hard to tell if your workaround has worked or not, but we are reasonably confident that making the JVM versions on your server and client line up exactly helps prevent the problem. We noticed this specifically on OS X because our workers had Java auto-update, and when we turned it off the error incidence went way down. If you are having this problem, try making sure your Java versions are the same.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jthompson@cloudbees.com (JIRA)

unread,
Oct 29, 2018, 5:41:02 PM10/29/18
to jenkinsc...@googlegroups.com

This looks like a communication failure between master and agent. The connection can be broken by many external causes. Commonly these have to do with networking, system, or other environmental issues. As Edward Yang noted sometimes these can be corrected by making sure versions are lined up. Sometimes it is due to a virtualization or containerization environment closing things down.
It's difficult to suggest where you should investigate to determine the issue. However, there currently isn't enough information provided to take any action.

jthompson@cloudbees.com (JIRA)

unread,
Oct 29, 2018, 5:42:01 PM10/29/18
to jenkinsc...@googlegroups.com
Jeff Thompson closed an issue as Cannot Reproduce
 

Since the reporter said that this was now working for them, I'm going to close it out. Hopefully they'll continue to have success.

Change By: Jeff Thompson
Status: Open Closed
Resolution: Cannot Reproduce

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

unread,
Nov 16, 2018, 5:50:03 PM11/16/18
to jenkinsc...@googlegroups.com
Mark Waite updated Bug JENKINS-50019
 

Fixed in git client plugin 2.7.4 thanks to PR 359 from Vincent Latombe.

Change By: Mark Waite
Status: Closed Fixed but Unreleased
Resolution: Cannot Reproduce Fixed

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

unread,
Nov 16, 2018, 5:51:03 PM11/16/18
to jenkinsc...@googlegroups.com

jonathan_tancer@colpal.com (JIRA)

unread,
Mar 22, 2019, 7:55:03 AM3/22/19
to jenkinsc...@googlegroups.com

r.oosterholt@gmail.com (JIRA)

unread,
Jan 9, 2020, 4:42:03 AM1/9/20
to jenkinsc...@googlegroups.com

Rebooting did the trick for me to. Thanks!

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages