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

java.lang.NoClassDefFoundError: io/opentelemetry/semconv/ExceptionAttributes #1036

Open
mulmschneider opened this issue Feb 5, 2025 · 2 comments
Assignees

Comments

@mulmschneider
Copy link

mulmschneider commented Feb 5, 2025

Jenkins and plugins versions report

I installed the opentelemetry-plugin and now Jenkins seems to no longer able to restart itself (see log output below). I suspect this is partly caused by the fact that my Opentelemetry config being broken (the server returns an error).

Environment
Jenkins: 2.479.3
OS: Linux - 6.8.0-1021-gcp
Java: 21.0.5 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
Office-365-Connector:5.0.0
analysis-model-api:12.9.1
ansicolor:1.0.5
ant:511.v0a_a_1a_334f41b_
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.4-136.v5a_21779c63f8
artifactory:4.0.8
asm-api:9.7.1-97.v4cc844130d97
authentication-tokens:1.119.v50285141b_7e1
aws-credentials:243.v41c19a_fb_5dcf
aws-java-sdk:1.12.772-477.v650d756dcf6d
aws-java-sdk-api-gateway:1.12.772-477.v650d756dcf6d
aws-java-sdk-autoscaling:1.12.772-477.v650d756dcf6d
aws-java-sdk-cloudformation:1.12.772-477.v650d756dcf6d
aws-java-sdk-cloudfront:1.12.772-477.v650d756dcf6d
aws-java-sdk-cloudwatch:1.12.772-477.v650d756dcf6d
aws-java-sdk-codebuild:1.12.772-477.v650d756dcf6d
aws-java-sdk-codedeploy:1.12.772-477.v650d756dcf6d
aws-java-sdk-ec2:1.12.772-477.v650d756dcf6d
aws-java-sdk-ecr:1.12.772-477.v650d756dcf6d
aws-java-sdk-ecs:1.12.772-477.v650d756dcf6d
aws-java-sdk-efs:1.12.772-477.v650d756dcf6d
aws-java-sdk-elasticbeanstalk:1.12.772-477.v650d756dcf6d
aws-java-sdk-elasticloadbalancingv2:1.12.772-477.v650d756dcf6d
aws-java-sdk-iam:1.12.772-477.v650d756dcf6d
aws-java-sdk-kinesis:1.12.772-477.v650d756dcf6d
aws-java-sdk-lambda:1.12.772-477.v650d756dcf6d
aws-java-sdk-logs:1.12.772-477.v650d756dcf6d
aws-java-sdk-minimal:1.12.772-477.v650d756dcf6d
aws-java-sdk-organizations:1.12.772-477.v650d756dcf6d
aws-java-sdk-secretsmanager:1.12.772-477.v650d756dcf6d
aws-java-sdk-sns:1.12.772-477.v650d756dcf6d
aws-java-sdk-sqs:1.12.772-477.v650d756dcf6d
aws-java-sdk-ssm:1.12.772-477.v650d756dcf6d
aws-java-sdk2-core:2.30.10-22.v1339d66b_e0f4
aws-java-sdk2-ec2:2.30.10-22.v1339d66b_e0f4
basic-branch-build-strategies:190.v343a_ee70d920
blueocean:1.27.16
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.16
blueocean-commons:1.27.16
blueocean-config:1.27.16
blueocean-core-js:1.27.16
blueocean-dashboard:1.27.16
blueocean-display-url:2.4.3
blueocean-events:1.27.16
blueocean-git-pipeline:1.27.16
blueocean-github-pipeline:1.27.16
blueocean-i18n:1.27.16
blueocean-jira:1.27.16
blueocean-jwt:1.27.16
blueocean-personalization:1.27.16
blueocean-pipeline-api-impl:1.27.16
blueocean-pipeline-editor:1.27.16
blueocean-pipeline-scm-api:1.27.16
blueocean-rest:1.27.16
blueocean-rest-impl:1.27.16
blueocean-web:1.27.16
bootstrap5-api:5.3.3-1
bouncycastle-api:2.30.1.80-256.vf98926042a_9b_
branch-api:2.1208.vf528356feca_4
build-timeout:1.35
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.2.1
cloudbees-bitbucket-branch-source:934.4.1
cloudbees-folder:6.980.v5a_cc0cb_25881
cobertura:1.17
code-coverage-api:4.99.0
command-launcher:118.v72741845c17a_
commons-compress-api:1.26.1-2
commons-lang3-api:3.17.0-84.vb_b_938040b_078
commons-text-api:1.13.0-153.v91dcd89e2a_22
conditional-buildstep:1.5.0
config-file-provider:982.vb_a_e458a_37021
copyartifact:761.vea_2b_25523e84
coverage:1.16.1
credentials:1405.vb_cda_74a_f8974
credentials-binding:687.v619cb_15e923f
data-tables-api:2.1.8-1
display-url-api:2.209.v582ed814ff2f
docker-commons:445.v6b_646c962a_94
docker-workflow:592.v1001d948426c
durable-task:581.v299a_5609d767
echarts-api:5.5.1-5
eddsa-api:0.3.0-4.v84c6f0f4969e
email-ext:1876.v28d8d38315b_d
extended-read-permission:61.vf24570ff3b_e9
fast-stash:3.0
favorite:2.225.v68765b_b_a_1fa_3
font-awesome-api:6.6.0-2
forensics-api:2.7.0
git:5.7.0
git-client:6.1.1
git-server:126.v0d945d8d2b_39
github:1.41.0
github-api:1.321-478.vc9ce627ce001
github-branch-source:1810.v913311241fa_9
gradle:2.14
gson-api:2.12.1-113.v347686d6729f
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
htmlpublisher:1.37
http_request:1.20
ignore-changes-strategy:1.0-SNAPSHOT (private-01/21/2019 16:04-ulmi)
instance-identity:201.vd2a_b_5a_468a_a_6
ionicons-api:74.v93d5eb_813d5f
jackson2-api:2.17.0-379.v02de8ec9f64c
jakarta-activation-api:2.1.3-1
jakarta-mail-api:2.1.3-1
javadoc:310.v032f3f16b_0f8
javax-activation-api:1.2.0-7
javax-mail-api:1.6.2-10
jaxb:2.3.9-1
jdk-tool:83.v417146707a_3d
jenkins-design-language:1.27.16
jersey2-api:2.45-154.v4ded3dc34f81
jira:3.13
jjwt-api:0.11.5-112.ve82dfb_224b_a_d
jnr-posix-api:3.1.20-125.vb_6ec4b_21b_15e
joda-time-api:2.13.1-115.va_6b_5f8efb_1d8
jquery:1.12.4-3
jquery3-api:3.7.1-2
jsch:0.2.16-86.v42e010d9484b_
json-api:20250107-125.v28b_a_ffa_eb_f01
json-path-api:2.9.0-138.vc943da_d833b_6
junit:1312.v1a_235a_b_94a_31
ldap:776.vddf3e325103b_
lockable-resources:1342.v673282c325c0
mailer:489.vd4b_25144138f
mapdb-api:1.0.9-40.v58107308b_7a_7
material-theme:0.5.2-rc100.6121925fe229
matrix-auth:3.2.4
matrix-project:845.vffd7fa_f27555
maven-plugin:3.24
mercurial:1308.v0e0888fdb_628
metrics:4.2.21-461.v881e35d8fa_b_a_
mina-sshd-api-common:2.14.0-143.v2b_362fc39576
mina-sshd-api-core:2.14.0-143.v2b_362fc39576
node-iterator-api:55.v3b_77d4032326
okhttp-api:4.11.0-183.va_87fc7a_89810
opentelemetry:3.1487.vf27fcf83deb_b_
opentelemetry-api:1.44.1.40.v93f5f8ca_42c3
pam-auth:1.11
parameterized-trigger:840.v3c7d4a_a_5e6c7
pipeline-build-step:551.v178956c49ef8
pipeline-github-lib:61.v629f2cc41d83
pipeline-graph-analysis:216.vfd8b_ece330ca_
pipeline-graph-view:407.v7857c9611b_44
pipeline-groovy-lib:749.v70084559234a_
pipeline-input-step:508.v584c0e9a_2177
pipeline-milestone-step:119.vdfdc43fc3b_9a_
pipeline-model-api:2.2221.vc657003fb_d93
pipeline-model-definition:2.2221.vc657003fb_d93
pipeline-model-extensions:2.2221.vc657003fb_d93
pipeline-rest-api:2.34
pipeline-stage-step:312.v8cd10304c27a_
pipeline-stage-tags-metadata:2.2221.vc657003fb_d93
pipeline-stage-view:2.34
pipeline-utility-steps:2.18.0
plain-credentials:183.va_de8f1dd5a_2b_
plugin-util-api:5.1.0
prism-api:1.29.0-18
pubsub-light:1.18
resource-disposer:0.25
role-strategy:756.v978cb_392eb_d3
run-condition:243.v3c3f94e46a_8b_
saml:4.525.v4f6a_7209447e
scm-api:703.v72ff4b_259600
script-security:1369.v9b_98a_4e95b_2d
slack:761.v2a_8770f0d169
snakeyaml-api:2.3-123.v13484c65210a_
sse-gateway:1.27
ssh-credentials:349.vb_8b_6b_9709f5b_
ssh-slaves:3.1021.va_cc11b_de26a_e
sshd:3.330.vc866a_8389b_58
structs:338.v848422169819
subversion:1283.vfc8b_92d49a_06
tap:2.4.3
theme-manager:278.v2e3c063e42cc
timestamper:1.28
token-macro:442.v4f452dc3c7c0
trilead-api:2.147.vb_73cc728a_32e
variant:70.va_d9f17f859e0
warnings-ng:11.12.0
workflow-aggregator:600.vb_57cdd26fdd7
workflow-api:1363.v03f731255494
workflow-basic-steps:1079.vce64b_a_929c5a_
workflow-cps:4014.vcd7dc51d8b_30
workflow-durable-task-step:1405.v1fcd4a_d00096
workflow-job:1498.v33a_0c6f3a_4b_4
workflow-multibranch:800.v5f0a_a_660950e
workflow-scm-step:427.v4ca_6512e7df1
workflow-step-api:686.v603d058a_e148
workflow-support:944.v5a_859593b_98a_
ws-cleanup:0.48

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

Docker image jenkins/jenkins:2.479.3-lts-jdk21

Reproduction steps

  1. Install a plugin
  2. Click "Restart Jenkins after plugin install"
  3. Wait forever

Expected Results

Jenkins restarts normally

Actual Results

2025-02-05 13:05:34.552+0000 [id=179]   INFO    jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
2025-02-05 13:05:34.597+0000 [id=179]   INFO    jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
2025-02-05 13:05:34.607+0000 [id=179]   INFO    jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
2025-02-05 13:05:34.608+0000 [id=179]   SEVERE  jenkins.model.Jenkins#_cleanUpPluginServletFilters: Failed to stop filters
java.lang.ClassNotFoundException: org.jenkinsci.plugins.ssegateway.SubscriptionConfigQueue$SubscriptionConfig
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:64)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
Caused: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/ssegateway/SubscriptionConfigQueue$SubscriptionConfig
        at PluginClassLoader for sse-gateway//org.jenkinsci.plugins.ssegateway.SubscriptionConfigQueue.stop(SubscriptionConfigQueue.java:106)
        at PluginClassLoader for sse-gateway//org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.destroy(Endpoint.java:253)
        at io.jenkins.servlet.FilterWrapper$1.destroy(FilterWrapper.java:59)
        at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:232)
        at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:4020)
        at jenkins.model.Jenkins.cleanUp(Jenkins.java:3717)
        at hudson.lifecycle.ExitLifecycle.restart(ExitLifecycle.java:68)
        at jenkins.model.Jenkins$20.run(Jenkins.java:4774)
2025-02-05 13:05:34.612+0000 [id=179]   SEVERE  hudson.lifecycle.ExitLifecycle#restart: Failed to clean up. Restart will continue.
java.lang.ClassNotFoundException: io.opentelemetry.semconv.ExceptionAttributes
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:64)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
Caused: java.lang.NoClassDefFoundError: io/opentelemetry/semconv/ExceptionAttributes
        at PluginClassLoader for opentelemetry//io.jenkins.plugins.opentelemetry.init.OtelJulHandler.publish(OtelJulHandler.java:107)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at java.logging/java.util.logging.Logger.doLog(Unknown Source)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:4025)
        at jenkins.model.Jenkins.cleanUp(Jenkins.java:3717)
        at hudson.lifecycle.ExitLifecycle.restart(ExitLifecycle.java:68)
        at jenkins.model.Jenkins$20.run(Jenkins.java:4774)
2025-02-05 13:05:34.613+0000 [id=179]   WARNING jenkins.model.Jenkins$20#run: Failed to restart Jenkins
java.lang.ClassNotFoundException: io.opentelemetry.semconv.ExceptionAttributes
Caused: java.lang.NoClassDefFoundError: io/opentelemetry/semconv/ExceptionAttributes
        at PluginClassLoader for opentelemetry//io.jenkins.plugins.opentelemetry.init.OtelJulHandler.publish(OtelJulHandler.java:107)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at java.logging/java.util.logging.Logger.doLog(Unknown Source)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at hudson.lifecycle.ExitLifecycle.restart(ExitLifecycle.java:71)
        at jenkins.model.Jenkins$20.run(Jenkins.java:4774)
2025-02-05 13:05:34.613+0000 [id=179]   SEVERE  h.i.i.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler#uncaughtException: A thread (safe-restart thread/179) died unexpectedly due to an uncaught exception. This may leave your server corrupted and usually indicates a software bug.
java.lang.ClassNotFoundException: io.opentelemetry.semconv.ExceptionAttributes
Caused: java.lang.NoClassDefFoundError: io/opentelemetry/semconv/ExceptionAttributes
        at PluginClassLoader for opentelemetry//io.jenkins.plugins.opentelemetry.init.OtelJulHandler.publish(OtelJulHandler.java:107)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at java.logging/java.util.logging.Logger.doLog(Unknown Source)
        at java.logging/java.util.logging.Logger.log(Unknown Source)
        at jenkins.model.Jenkins$20.run(Jenkins.java:4779)

Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "safe-restart thread"
2025-02-05 13:05:35.401+0000 [id=85]    WARNING i.o.s.internal.ThrottlingLogger#doLog: Failed to export logs. Server responded with gRPC status code 2. Error message: Not Found
2025-02-05 13:05:52.193+0000 [id=76]    WARNING i.o.s.internal.ThrottlingLogger#doLog: An exception occurred invoking callback for CallbackRegistration{instrumentDescriptors=[InstrumentDescriptor{name=jenkins.executor.online, description=Online executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.available, description=Available executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.total, description=Total executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.busy, description=Busy executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.queue, description=Executors queue items, unit=${items}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.idle, description=Idle executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.node, description=Nodes, unit=${nodes}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.defined, description=Defined executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor.connecting, description=Connecting executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}, InstrumentDescriptor{name=jenkins.executor, description=Per label executors, unit=${executors}, type=OBSERVABLE_GAUGE, valueType=LONG, advice=Advice{explicitBucketBoundaries=null, attributes=null}}]}.
java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.

Anything else?

No response

Are you interested in contributing a fix?

Unfortunately I can't.

@cyrille-leclerc
Copy link
Contributor

io.jenkins.plugins.opentelemetry.init.OtelJulHandler registers itself as a j.u.l.Handler at initialization (@PostConstruct), it should unregister itself when the plugin unloads.

@cyrille-leclerc cyrille-leclerc self-assigned this Feb 7, 2025
@cyrille-leclerc
Copy link
Contributor

Fix merged. Release should be creted automatically

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

No branches or pull requests

2 participants