Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins agents with Jdk17 error: hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @1c1618cf #207

Closed
prudhvigodithi opened this issue Oct 12, 2021 · 29 comments

Comments

@prudhvigodithi
Copy link

prudhvigodithi commented Oct 12, 2021

Version report

Using jenkins master: 2.249.2
Jenkins remoting version: 4.10
Connection Protocol: websocket
Java version: openjdk version "17" 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode)

Jenkins agent log:
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by hudson.remoting.jnlp.Main (file:/usr/share/jenkins/agent.jar)
WARNING: Please consider reporting this to the maintainers of hudson.remoting.jnlp.Main
WARNING: System::setSecurityManager will be removed in a future release
Oct 12, 2021 10:29:48 AM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: ditest-jdk17-medium-2m1ph
Oct 12, 2021 10:29:48 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Oct 12, 2021 10:29:48 AM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 4.10
Oct 12, 2021 10:29:48 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /home/jenkins/remoting as a remoting work directory
Oct 12, 2021 10:29:48 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to /home/jenkins/remoting
Oct 12, 2021 10:29:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: WebSocket connection open
Oct 12, 2021 10:29:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Oct 12, 2021 10:30:02 AM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave$SlaveDisconnector call
INFO: Disabled slave engine reconnects.
Oct 12, 2021 10:30:02 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Write side closed
Oct 12, 2021 10:30:02 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Read side closed
Oct 12, 2021 10:30:02 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
Oct 12, 2021 10:30:02 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Read side closed


Jenkins build exit log:
hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @1c1618cf
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.lang.reflect.Field.checkCanSetAccessible(Unknown Source)
	at java.lang.reflect.Field.setAccessible(Unknown Source)
	at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
	at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to ditest-jdk17-medium-2m1ph
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:1001)
		at hudson.FilePath.act(FilePath.java:1070)
		at hudson.FilePath.act(FilePath.java:1059)
		at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:121)
		at hudson.plugins.git.GitSCM.createClient(GitSCM.java:902)
		at hudson.plugins.git.GitSCM.createClient(GitSCM.java:833)
		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1286)
		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
		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$Worker.run(ThreadPoolExecutor.java:624)
		at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ProxyException: java.lang.ExceptionInInitializerError
	at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:811)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
	at hudson.util.XStream2.<init>(XStream2.java:113)
	at hudson.ProxyConfiguration.<clinit>(ProxyConfiguration.java:392)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at jdk.proxy4.$Proxy11.<clinit>(Unknown Source)
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
	at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
	at hudson.remoting.RemoteInvocationHandler.wrap(RemoteInvocationHandler.java:169)
	at hudson.remoting.Channel.export(Channel.java:813)
	at hudson.remoting.Channel.export(Channel.java:776)
	at org.jenkinsci.plugins.gitclient.LegacyCompatibleGitAPIImpl.writeReplace(LegacyCompatibleGitAPIImpl.java:204)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeWriteReplace(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at hudson.remoting.UserRequest._serialize(UserRequest.java:263)
	at hudson.remoting.UserRequest.serialize(UserRequest.java:272)
	at hudson.remoting.UserRequest.perform(UserRequest.java:222)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:376)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.lang.Thread.run(Unknown Source)
Finished: FAILURE
  • What Operating System are you using (both controller, and any agents involved in the problem)?
using Docker image jenkins/agent:latest-jdk17-preview which has Debain OS

Reproduction steps

  • Using the Default agent as jenkins/agent:latest-jdk17-preview with entrypoint from https://github.com/jenkinsci/docker-inbound-agent.
  • Using this as entrypoint https://github.com/jenkinsci/docker-inbound-agent/blob/master/jenkins-agent to the agent caused the above error, somehow I see the compatibility with the new jdk17 version.
  • Starting the agent using jenkins kubernetes plugin, below are the logs:
    WARNING: A terminally deprecated method in java.lang.System has been called
    WARNING: System::setSecurityManager has been called by hudson.remoting.jnlp.Main (file:/usr/share/jenkins/agent.jar)
    WARNING: Please consider reporting this to the maintainers of hudson.remoting.jnlp.Main
    WARNING: System::setSecurityManager will be removed in a future release

Expected result:
Expected to work normal to start the agent and continue to run the build without the error hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @1c1618cf

Actual result:
Job Exits with a failure result as Caused: hudson.remoting.ProxyException: java.lang.ExceptionInInitializerError
@prudhvigodithi prudhvigodithi changed the title Jenkins agents Jdk17 error hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @1c1618cf Jenkins agents with Jdk17 error: hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @1c1618cf Oct 12, 2021
@timja
Copy link
Member

timja commented Oct 12, 2021

Sure it'll need something like:
https://github.com/jenkinsci/docker/blob/master/jenkins.sh#L37-L44

I had that initially but then I removed it as I wasn't able to trigger any of these issues.

Feel like contributing a fix?

@prudhvigodithi
Copy link
Author

Hey @timja, thanks for reaching back, you mean to try adding those flags to this entry point https://github.com/jenkinsci/docker-inbound-agent/blob/master/jenkins-agent and test the agent again if works create a PR adding those flags for jdk17 entry point? ( https://github.com/jenkinsci/docker-inbound-agent/blob/master/jenkins-agent)
Thank you

@timja
Copy link
Member

timja commented Oct 12, 2021

Yes, bearing in mind that the entrypoint here uses sh whereas jenkins.sh uses bash

@prudhvigodithi
Copy link
Author

prudhvigodithi commented Oct 12, 2021

Thanks @timja
I have tested with those FUTURE_OPTS flags somehow I still get the error, below I have pasted the error log.

Connection Command

exec /opt/jdk/bin/java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED  -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless  -url https://jenkins.test.aws/test/ -workDir /home/jenkins -webSocket   35cee8f9dfebe735b48c8d2a420f609005847607c60c test-jdk17-medium-g8bdm 

Error log

WARNING: System::setSecurityManager has been called by hudson.remoting.jnlp.Main (file:/usr/share/jenkins/agent.jar)
WARNING: Please consider reporting this to the maintainers of hudson.remoting.jnlp.Main
WARNING: System::setSecurityManager will be removed in a future release
Oct 12, 2021 12:31:03 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: ditest-jdk17-medium-g8bdm
Oct 12, 2021 12:31:03 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Oct 12, 2021 12:31:03 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 4.10
Oct 12, 2021 12:31:03 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /home/jenkins/remoting as a remoting work directory
Oct 12, 2021 12:31:03 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to /home/jenkins/remoting
Oct 12, 2021 12:31:04 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: WebSocket connection open
Oct 12, 2021 12:31:04 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Oct 12, 2021 12:31:22 PM jenkins.model.Jenkins <clinit>
SEVERE: Failed to load Jenkins.class
java.lang.ExceptionInInitializerError
	at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:824)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
	at hudson.util.XStream2.<init>(XStream2.java:113)
	at jenkins.model.Jenkins.<clinit>(Jenkins.java:5379)
	at jenkins.agents.AgentComputerUtil.getChannelToMaster(AgentComputerUtil.java:48)
	at hudson.util.ProcessTree.get(ProcessTree.java:432)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1164)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1155)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:376)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not "opens java.lang.reflect" to unnamed module @429de50b
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Field.setAccessible(Unknown Source)
	at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
	at com.thoughtworks.xstream.converters.extended.DynamicProxyConverter.<clinit>(DynamicProxyConverter.java:42)
	... 21 more

Oct 12, 2021 12:31:22 PM hudson.remoting.UserRequest perform
WARNING: LinkageError while performing UserRequest:hudson.Launcher$RemoteLauncher$KillTask@1f076ac1
java.lang.ExceptionInInitializerError
	at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:824)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
	at hudson.util.XStream2.<init>(XStream2.java:113)
	at jenkins.model.Jenkins.<clinit>(Jenkins.java:5379)
	at jenkins.agents.AgentComputerUtil.getChannelToMaster(AgentComputerUtil.java:48)
	at hudson.util.ProcessTree.get(ProcessTree.java:432)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1164)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1155)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:376)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not "opens java.lang.reflect" to unnamed module @429de50b
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Field.setAccessible(Unknown Source)
	at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
	at com.thoughtworks.xstream.converters.extended.DynamicProxyConverter.<clinit>(DynamicProxyConverter.java:42)
	... 21 more

Oct 12, 2021 12:31:22 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave$SlaveDisconnector call
INFO: Disabled slave engine reconnects.
Oct 12, 2021 12:31:22 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Write side closed
Oct 12, 2021 12:31:22 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Read side closed
Oct 12, 2021 12:31:22 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
Oct 12, 2021 12:31:22 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Read side closed

@timja
Copy link
Member

timja commented Oct 12, 2021

According to the error you need to add java.lang.reflect to the modules list

@prudhvigodithi
Copy link
Author

Hey @timja I have added the following OPTS
"--add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED

I still got an error
Error log
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected java.lang.String java.text.AttributedCharacterIterator$Attribute.getName() accessible: module java.base does not "opens java.text" to unnamed module @79a9f151

@timja you mentioned you had this initially but then removed later, did you manage to fix error without these
FUTURE_OPTS="--add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED

@timja
Copy link
Member

timja commented Oct 12, 2021

Next error is java.text

initially I copied the options from jenkinsci/docker but then I tested without and found that basic steps worked fine without it

@prudhvigodithi
Copy link
Author

Ya just added the following, running some tests

--add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED

@timja
Copy link
Member

timja commented Oct 12, 2021

What made you add java.awt.font?

@prudhvigodithi
Copy link
Author

just removed the java.awt.font, not including in my tests, added it as I copy the --add-opens from the existing app.

@prudhvigodithi
Copy link
Author

prudhvigodithi commented Oct 12, 2021

yes it requires --add-opens java.desktop/java.awt.font=ALL-UNNAMED
Error log:

java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.Map java.awt.font.TextAttribute.instanceMap accessible: module java.desktop does not "opens java.awt.font" to unnamed module @6f6b13c6
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)

@timja
Copy link
Member

timja commented Oct 12, 2021

You got a bigger stacktrace for it?

@prudhvigodithi
Copy link
Author

Hey @timja sorry for late reply, below I have shared the error log

FATAL: java.lang.ExceptionInInitializerError
hudson.remoting.ProxyException: java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.Map java.awt.font.TextAttribute.instanceMap accessible: module java.desktop does not "opens java.awt.font" to unnamed module @6f6b13c6
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.lang.reflect.Field.setAccessible(Field.java:172)
	at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
	at com.thoughtworks.xstream.converters.reflection.AbstractAttributedCharacterIteratorAttributeConverter.readResolve(AbstractAttributedCharacterIteratorAttributeConverter.java:106)
	at com.thoughtworks.xstream.converters.reflection.AbstractAttributedCharacterIteratorAttributeConverter.<init>(AbstractAttributedCharacterIteratorAttributeConverter.java:65)
	at com.thoughtworks.xstream.converters.extended.TextAttributeConverter.<init>(TextAttributeConverter.java:33)
	at com.thoughtworks.xstream.converters.extended.FontConverter.<init>(FontConverter.java:56)
	at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:830)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
	at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
	at hudson.util.XStream2.<init>(XStream2.java:113)
	at jenkins.model.Jenkins.<clinit>(Jenkins.java:5379)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to ditest-jdk17-medium-4w1q2
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:1001)
		at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1147)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
		at hudson.model.Run.execute(Run.java:1894)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:428)
Caused: hudson.remoting.ProxyException: java.lang.ExceptionInInitializerError
	at jenkins.agents.AgentComputerUtil.getChannelToMaster(AgentComputerUtil.java:48)
	at hudson.util.ProcessTree.get(ProcessTree.java:432)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1164)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1155)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:376)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.lang.Thread.run(Thread.java:833)

@timja
Copy link
Member

timja commented Oct 15, 2021

Interesting, we can likely work around that in Jenkins core by removing that converter which we don't need, but it can be added to the add-opens for for

@prudhvigodithi
Copy link
Author

True So moving forward @timja for users to use jdk17 should I add a PR for https://github.com/jenkinsci/docker-inbound-agent/blob/master/jenkins-agent or will it be added in Jenkins core with the next version?

@timja
Copy link
Member

timja commented Oct 15, 2021

Add a PR for here for now please

@prudhvigodithi
Copy link
Author

@timja sure, here do you suggest to add it for jdk17 docker image or create a new entry point file?

@timja
Copy link
Member

timja commented Oct 15, 2021

same way as in jenkinsci/docker entrypoint, set an environment variable in the dockerfile

https://github.com/jenkinsci/docker/blob/master/17/debian/bullseye/hotspot/Dockerfile#L105

then https://github.com/jenkinsci/docker/blob/master/jenkins.sh#L38

(remembering that script is bash, while this is using sh)

@basil
Copy link
Member

basil commented Mar 10, 2022

Does anyone have steps to reproduce this issue from scratch? I was thinking about moving the --add-opens lines from https://github.com/jenkinsci/docker-inbound-agent/blob/516b518fc78066d7f6ea271b548e32eb7e6db4fc/jenkins-agent#L133-L139 to an <Add-Opens> entry in Remoting's MANIFEST.MF (as in jenkinsci/jenkins#6356), so first I wanted to reproduce the stack trace mentioned in this issue when there are no --add-opens directives. But I was unable to reproduce the original problem on the latest Jenkins weekly (Jenkins 2.338, Remoting 4.13, XStream 1.4.19) when running controller and agent on Java 17 (OpenJDK) both with and without WebSocket mode without any --add-opens directives or custom entries in MANIFEST.MF. I was able to run a Pipeline job to completion on the agent and was even able to successfully run new hudson.util.XStream2() in the agent's script console. If we do still need these directives, it would be nice to know how to reproduce the stack trace mentioned in this bug. Then I can test that the stack trace occurs without any --add-opens directives, does not occur with --add-opens on the CLI, and does not occur with <Add-Opens> in Remoting's MANIFEST.MF.

@timja
Copy link
Member

timja commented Mar 11, 2022

I tried to reproduce this and wasn't able to. =/

@bob-rohan do you have an example you could share from here? jenkinsci/docker-inbound-agent#252

@bob-rohan
Copy link
Contributor

bob-rohan commented Mar 11, 2022

I don't @timja , I not longer have access for the client where this work was done. I'll reach out see if someone could pick this up

@basil
Copy link
Member

basil commented Mar 11, 2022

So maybe we should conclude that these --add-opens directives aren't needed anymore and remove them? Though that could cause a regression if they are needed. Alternatively, we could convert them to <Add-Opens> in MANIFEST.MF in Remoting, which would clean up the code, but I would have no way to easily test this. Or we could maintain the status quo, but I think that is the worst option.

@timja
Copy link
Member

timja commented Mar 11, 2022

we could remove for now and see if someone can provide a way to reproduce if we hit it.

@basil
Copy link
Member

basil commented Mar 11, 2022

One YOLO PR coming up.

@shawngmc

This comment was marked as off-topic.

@basil
Copy link
Member

basil commented Jul 27, 2022

@shawngmc That stack trace seems to come from the controller, so I have no idea why you are posting it on an issue in the docker-agent repository.

@shawngmc
Copy link

@shawngmc That stack trace seems to come from the controller, so I have no idea why you are posting it on an issue in the docker-agent repository.

Argh - you're right. That is from the controller. I think I simply copied/pasted into the wrong GitHub tab; pretty sure I meant to paste into jenkinsci/docker-plugin#905

Getting Jenkins itself, the docker plugin, and a docker jenkins worker image all talking together happily is... painful.

@dduportal
Copy link
Contributor

Ping on this issue: is it still reproduceable or shall we close it?

@timja timja closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2022
@basil
Copy link
Member

basil commented Nov 12, 2022

This ticket was filed in the wrong repository and was fixed in jenkinsci/jenkins#7270.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants