question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.util.concurrent.atomic.AtomicBoolean.serialVersionUID accessible

See original GitHub issue

Jenkins and plugins versions report

Environment
Jenkins: 2.346.2
OS: Linux - 5.4.0-1086-azure
---
Office-365-Connector:4.15.0
ace-editor:1.1
analysis-model-api:10.10.0
ant:1.11
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.13.2
audit-trail:3.10
authentication-tokens:1.4
azure-app-service:1.0.2
azure-commons:1.1.3
azure-credentials:198.vf9c2fdfde55c
azure-function:0.3.3
azure-sdk:61.v6a8af1f5f5b6
azure-vm-agents:9999-SNAPSHOT (private-05/24/2021 10:28-eryc02c)
basic-branch-build-strategies:1.3.2
bitbucket:1.1.29
blueocean:1.24.8
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.8
blueocean-commons:1.24.8
blueocean-config:1.24.8
blueocean-core-js:1.24.8
blueocean-dashboard:1.24.8
blueocean-display-url:2.4.1
blueocean-events:1.24.8
blueocean-git-pipeline:1.24.8
blueocean-github-pipeline:1.24.8
blueocean-i18n:1.24.8
blueocean-jwt:1.24.8
blueocean-personalization:1.24.8
blueocean-pipeline-api-impl:1.24.8
blueocean-pipeline-editor:1.24.8
blueocean-pipeline-scm-api:1.24.8
blueocean-rest:1.24.8
blueocean-rest-impl:1.24.8
blueocean-web:1.24.8
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-6
bouncycastle-api:2.25
branch-api:2.1044.v2c007e51b_87f
build-timestamp:1.0.3
build-user-vars-plugin:1.8
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloud-stats:0.27
cloudbees-bitbucket-branch-source:2.9.9
cloudbees-folder:6.714.v79e858ef76a_2
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.8.0
copyartifact:1.46.1
credentials:2.6.2
credentials-binding:1.27
cucumber-reports:5.7.1
data-tables-api:1.11.4-4
display-url-api:2.3.5
docker-commons:1.19
docker-java-api:3.1.5.2
docker-plugin:1.2.2
docker-workflow:1.26
durable-task:1.37
echarts-api:5.3.0-2
email-ext:2.83
embeddable-build-status:2.0.3
extended-choice-parameter:0.82
extended-read-permission:3.2
extensible-choice-parameter:1.7.0
external-monitor-job:1.7
favorite:2.3.3
font-awesome-api:6.0.0-1
forensics-api:1.12.0
generic-webhook-trigger:1.77
git:4.7.2
git-client:3.7.2
git-parameter:0.9.13
git-server:1.10
github:1.33.1
github-api:1.123
github-branch-source:2.10.2
gitlab-plugin:1.5.20
gradle:1.36
greenballs:1.15.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http_request:1.11
ivy:2.1
jackson2-api:2.13.2.20220328-273.v11d70a_b_a_1a_52
jacoco:3.3.0
javadoc:1.6
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0
jdk-tool:1.5
jenkins-design-language:1.24.8
jira-steps:1.6.0
jjwt-api:0.11.2-9.c8b45b8bb173
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.50
ldap:2.7
lockable-resources:2.11
mailer:408.vd726a_1130320
mapdb-api:1.0.9.0
mask-passwords:3.0
matrix-auth:2.6.7
matrix-project:1.20
maven-plugin:3.12
mercurial:2.15
mission-control-view:0.9.16
momentjs:1.1.1
monitoring:1.87.0
multibranch-build-strategy-extension:1.0.10
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.44
pipeline-build-step:2.17
pipeline-github-lib:1.0
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.5
pipeline-model-definition:1.8.5
pipeline-model-extensions:1.8.5
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.5
pipeline-stage-view:2.19
pipeline-utility-steps:2.8.0
plain-credentials:1.7
plugin-util-api:2.16.0
popper-api:1.16.1-2
popper2-api:2.11.5-1
postbuild-task:1.9
postbuildscript:3.1.0-369.vb_cc225753c4b_
prism-api:1.26.0-2
pubsub-light:1.16
resource-disposer:0.16
role-strategy:3.1.1
run-condition:1.5
scm-api:602.v6a_81757a_31d2
script-security:1145.vb_cf6cf6ed960
snakeyaml-api:1.29.1
sonar:2.13.1
sse-gateway:1.24
ssh-agent:1.24.1
ssh-credentials:1.19
ssh-slaves:1.33.0
ssh-steps:2.0.0
sshd:3.1.0
structs:318.va_f3ccb_729b_71
subversion:2.15.4
thinBackup:1.10
throttle-concurrents:2.3
timestamper:1.13
token-macro:293.v283932a_0a_b_49
trilead-api:1.0.13
uno-choice:2.5.6
uploaded1674241992762064703:???
uploaded3602274684500494963:???
uploaded553185394649542620:???
uploaded5882287038286726:???
uploaded707806167046363854:???
variant:1.4
veracode-scan:21.6.13.0
view-job-filters:2.3
warnings-ng:9.11.1
windows-slaves:1.8.1
workflow-aggregator:2.6
workflow-api:1143.v2d42f1e9dea_5
workflow-basic-steps:2.23
workflow-cps:2686.v7c37e0578401
workflow-cps-global-lib:570.v21311f4951f8
workflow-durable-task-step:2.39
workflow-job:1174.vdcb_d054cf74a_
workflow-multibranch:711.vdfef37cda_816
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:817.v58126df57338
ws-cleanup:0.39

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 20

Reproduction steps

Start a build which utilizes docker-plugin

Expected Results

A docker container is created, connected to, and job run on it

Actual Results

The job hangs forever. Looking at the Jenkins System log, I see the following over and over again:

Trying to run container for node mps-ubuntu-00000js6z985s from image: mck-mps-docker-registry-virtual.jfrog.io/mps-ubuntu:18.04
Jul 13, 2022 10:46:39 PM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
Started container ID 9f9023798eb3fa691e862a6fd0dae57ab46b57c5a7ea0b57dd8c72017e319525 for node mps-ubuntu-00000js6z985s from image: mck-mps-docker-registry-virtual.jfrog.io/mps-ubuntu:18.04
Jul 13, 2022 10:46:40 PM INFO com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH executeOnce
SSH port is open on 10.15.164.57:49459
Jul 13, 2022 10:46:41 PM SEVERE com.nirima.jenkins.plugins.docker.DockerCloud$1 run
Error in provisioning; template='DockerTemplate{configVersion=2, labelString='mps-ubuntu', connector=DockerComputerSSHConnector{sshKeyStrategy=ManuallyConfiguredSSHKey{credentialsId='jenkins-container', sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy@7312f408}, port=22}, remoteFs='/home/jenkins', instanceCap=2, mode=EXCLUSIVE, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@29, dockerTemplateBase=DockerTemplateBase{image='mck-mps-docker-registry-virtual.jfrog.io/mps-ubuntu:18.04', pullCredentialsId='6c2c6dee-7af0-4d77-ac39-1242d8171600', bindAllPorts=false, cpuPeriod=0, cpuQuota=0, privileged=false, tty=false}, removeVolumes=false, stopTimeout=10, pullStrategy=PULL_ALWAYS, pullTimeout=300, disabled=No, name='mps-ubuntu'}' for cloud='Docker Cloud West 01'
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.util.concurrent.atomic.AtomicBoolean.serialVersionUID accessible: module java.base does not "opens java.util.concurrent.atomic" to unnamed module @be35cd9
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildDictionaryEntryForClass(FieldDictionary.java:176)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildMap(FieldDictionary.java:142)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.fieldsFor(FieldDictionary.java:80)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:167)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:206)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:163)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:283)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:270)
Caused: java.lang.RuntimeException: Failed to serialize io.jenkins.docker.DockerTransientNode#acceptingTasks for class io.jenkins.docker.DockerTransientNode
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:274)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:241)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:174)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:226)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:163)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:44)
	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:83)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1266)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1255)
	at com.thoughtworks.xstream.XStream.toXML(XStream.java:1228)
	at hudson.XmlFile.write(XmlFile.java:213)
Caused: java.io.IOException
	at hudson.XmlFile.write(XmlFile.java:220)
	at jenkins.model.Nodes.persistNode(Nodes.java:183)
	at jenkins.model.Nodes.addNode(Nodes.java:148)
	at jenkins.model.Jenkins.addNode(Jenkins.java:2208)
	at com.nirima.jenkins.plugins.docker.DockerCloud.robustlyAddNodeToJenkins(DockerCloud.java:445)
	at com.nirima.jenkins.plugins.docker.DockerCloud.access$000(DockerCloud.java:68)
	at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:381)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
basilcommented, Oct 18, 2022

A month later, my pull request to XStream remains unacknowledged, so I integrated https://github.com/jenkinsci/jenkins/pull/7270 toward 2.375. This will provide support for serializing AtomicBoolean on Java 17, resolving the immediate issue, but serializing classes in the java.util.concurrent package is still not something we recommend: the implementation and representation of these concurrent types is more complex and prone to error, and we instead suggest declaring the persisted field to be of some simpler type (e.g., boolean) and using a transient field for an in-memory representation of a complex type. Though this issue can remain closed, I would ask that a new code cleanup task be filed to cover moving this plugin off AtomicBoolean at some point in time in the future: while the immediate pain will be resolved in 2.375 by https://github.com/jenkinsci/jenkins/pull/7270, in the long term this plugin would be less fragile if it used a simpler type.

0reactions
jglickcommented, Oct 19, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.reflect.InaccessibleObjectException: Unable to make ...
I solved my problem. Turns out the JRE that eclipse had automatically downloaded and was using wasn't compatible with this version of ...
Read more >
unable to make field private final java.lang.string java.io.file ...
reflect.InaccessibleObjectException: Unable to make field private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed accessible: module java.
Read more >
Package java.util.concurrent.atomic - Oracle Help Center
A long array in which elements may be updated atomically. A reflection-based utility that enables atomic updates to designated volatile long fields of ......
Read more >
Java 9 Compiler: Unable to make field private static final jdk ...
Unsafe.theUnsafe accessible: module java.base does not "opens jdk.internal.misc" to unnamed module @683dbc2c.
Read more >
"Serializable" classes should have a "serialVersionUID"
Java static code analysis. Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your JAVA code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found