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

NPE when disabling OpenTelemetry #38084

Closed
jamesnetherton opened this issue Jan 8, 2024 · 1 comment · Fixed by #38087
Closed

NPE when disabling OpenTelemetry #38084

jamesnetherton opened this issue Jan 8, 2024 · 1 comment · Fixed by #38087
Labels
area/tracing kind/bug Something isn't working
Milestone

Comments

@jamesnetherton
Copy link
Contributor

jamesnetherton commented Jan 8, 2024

Describe the bug

Something observed on the nightly Camel Quarkus builds with Quarkus 999-SNAPSHOT. We have a test where otel is disabled with quarkus.otel.enabled = false. The application fails to start due to:

java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
Caused by: java.lang.NullPointerException: Cannot invoke "io.smallrye.config.ConfigValue.getValue()" because "value" is null
    at io.quarkus.opentelemetry.runtime.config.OTelFallbackConfigSourceInterceptor.getValue(OTelFallbackConfigSourceInterceptor.java:46)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.SecretKeysHandlerConfigSourceInterceptor.getValue(SecretKeysHandlerConfigSourceInterceptor.java:26)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:382)
    at io.quarkus.runtime.configuration.ConfigRecorder.handleConfigChange(ConfigRecorder.java:43)
    at io.quarkus.deployment.steps.ConfigGenerationBuildStep$checkForBuildTimeConfigChange1532146938.deploy_4(Unknown Source)
    at io.quarkus.deployment.steps.ConfigGenerationBuildStep$checkForBuildTimeConfigChange1532146938.deploy(Unknown Source)
    ... 13 more

I see the same thing if I generate a basic app (E.g just with quarkus-otel & no Camel involved) from code.quarkus.io and tweak the Quarkus version to 999-SNAPSHOT.

Expected behavior

OpenTelemetry is disabled as expected without any issues.

Actual behavior

An NPE is thrown (see above stack trace).

How to Reproduce?

  1. Create an empty application
  2. Set the Quarkus version to 999-SNAPSHOT
  3. Add a dependency for quarkus-opentelemetry
  4. Disable otel in àpplication.propertieswithquarkus.otel.enabled = false`
  5. Package the application and execute the runnable JAR

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@jamesnetherton jamesnetherton added the kind/bug Something isn't working label Jan 8, 2024
Copy link

quarkus-bot bot commented Jan 8, 2024

/cc @brunobat (opentelemetry), @radcortez (opentelemetry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant