quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

NPE at io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.OpenTelemetryVertxTracingFactory$Delegator.sendRequest(OpenTelemetryVertxTracingFactory.java:71) #33669

Closed ikos23 closed 1 year ago

ikos23 commented 1 year ago

Describe the bug

Getting NPE at OpenTelemetryVertxTracingFactory when running tests !

My project setup:

3.0.3.Final 14 pom.xml ``` io.quarkus quarkus-resteasy-reactive-jackson io.quarkus quarkus-micrometer-registry-prometheus io.quarkus quarkus-hibernate-validator io.quarkus quarkus-opentelemetry io.quarkus quarkus-elytron-security io.quarkus quarkus-elytron-security-properties-file io.quarkus quarkus-oidc ``` application.properties ``` # I don't have any configs for OpenTelemetry (none), but I have these %test.quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317 %test.otel.sdk.disabled=true ``` When I run tests (as part of build or, just `mvn test`) I am getting NPE (not every time by the way). Here is an example of such run - I am using Testcontainers so here is logs with a bit of ocntext: ``` 29-May-2023 13:19:59 [INFO] ------------------------------------------------------- 29-May-2023 13:19:59 [INFO] T E S T S 29-May-2023 13:19:59 [INFO] ------------------------------------------------------- 29-May-2023 13:20:00 [INFO] Running foo.bar.DocumentResourceIT 29-May-2023 13:20:02 May 29, 2023 1:20:02 PM io.quarkus.elytron.security.properties.deployment.ElytronPropertiesProcessor configureMPRealmConfig 29-May-2023 13:20:02 INFO: Configuring from MPRealmConfig 29-May-2023 13:20:02 2023-05-29 13:20:02,777 INFO [org.tes.doc.DockerClientProviderStrategy] (build-68) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first 29-May-2023 13:20:03 2023-05-29 13:20:03,419 INFO [org.tes.doc.DockerClientProviderStrategy] (build-68) Found Docker environment with local Unix socket (unix:///var/run/docker.sock) 29-May-2023 13:20:03 2023-05-29 13:20:03,439 INFO [org.tes.DockerClientFactory] (build-68) Docker host IP address is 172.18.0.1 29-May-2023 13:20:03 2023-05-29 13:20:03,454 INFO [org.tes.DockerClientFactory] (build-68) Connected to docker: 29-May-2023 13:20:03 Server Version: 23.0.6 29-May-2023 13:20:03 API Version: 1.42 29-May-2023 13:20:03 Operating System: Ubuntu 20.04.6 LTS (containerized) 29-May-2023 13:20:03 Total Memory: 24104 MB 29-May-2023 13:20:03 2023-05-29 13:20:03,470 INFO [org.tes.uti.ImageNameSubstitutor] (build-68) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor') 29-May-2023 13:20:03 2023-05-29 13:20:03,473 INFO [org.tes.DockerClientFactory] (build-68) Checking the system... 29-May-2023 13:20:03 2023-05-29 13:20:03,474 INFO [org.tes.DockerClientFactory] (build-68) ?? Docker server version should be at least 1.6.0 29-May-2023 13:20:03 May 29, 2023 1:20:03 PM io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor$QuarkusOidcContainer configure 29-May-2023 13:20:03 INFO: Using Quarkus powered Keycloak distribution 29-May-2023 13:20:03 2023-05-29 13:20:03,736 INFO [? .io/.0.2]] (build-68) Creating container for image: quay.io/keycloak/keycloak:21.0.2 29-May-2023 13:20:03 2023-05-29 13:20:03,755 INFO [? .3.4]] (build-68) Creating container for image: testcontainers/ryuk:0.3.4 29-May-2023 13:20:04 2023-05-29 13:20:04,063 INFO [? .3.4]] (build-68) Container testcontainers/ryuk:0.3.4 is starting: 7b8ccbe65680625c5ccefa8562fcaf189935ece43a72598d5c5c0e42a6701b2e 29-May-2023 13:20:04 2023-05-29 13:20:04,661 INFO [? .3.4]] (build-68) Container testcontainers/ryuk:0.3.4 started in PT0.906354S 29-May-2023 13:20:04 2023-05-29 13:20:04,732 INFO [? .io/.0.2]] (build-68) Container quay.io/keycloak/keycloak:21.0.2 is starting: fb1cb459dfd167361cdce3c9eeaec0936ad4373839b7449bc38cc0e3a3adb960 29-May-2023 13:20:15 2023-05-29 13:20:15,787 INFO [? .io/.0.2]] (build-68) Container quay.io/keycloak/keycloak:21.0.2 started in PT12.186134S 29-May-2023 13:20:17 May 29, 2023 1:20:17 PM io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor startKeycloakContainer 29-May-2023 13:20:17 INFO: Dev Services for Keycloak started. 29-May-2023 13:20:18 May 29, 2023 1:20:17 PM org.hibernate.validator.internal.util.Version 29-May-2023 13:20:18 INFO: HV000001: Hibernate Validator 8.0.0.Final 29-May-2023 13:20:18 May 29, 2023 1:20:18 PM io.quarkus.vertx.core.runtime.VertxCoreRecorder$7 handle 29-May-2023 13:20:18 ERROR: Uncaught exception received by Vert.x 29-May-2023 13:20:18 java.lang.NullPointerException 29-May-2023 13:20:18 at io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.OpenTelemetryVertxTracingFactory$Delegator.sendRequest(OpenTelemetryVertxTracingFactory.java:71) 29-May-2023 13:20:18 at io.vertx.core.http.impl.Http1xClientConnection.beginRequest(Http1xClientConnection.java:273) 29-May-2023 13:20:18 at io.vertx.core.http.impl.Http1xClientConnection.access$600(Http1xClientConnection.java:108) 29-May-2023 13:20:18 at io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.writeHead(Http1xClientConnection.java:556) 29-May-2023 13:20:18 at io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.writeHead(Http1xClientConnection.java:549) 29-May-2023 13:20:18 at io.vertx.core.http.impl.HttpClientRequestImpl.doWrite(HttpClientRequestImpl.java:501) 29-May-2023 13:20:18 at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:471) 29-May-2023 13:20:18 at io.vertx.core.http.impl.HttpClientRequestImpl.end(HttpClientRequestImpl.java:417) 29-May-2023 13:20:18 at io.vertx.core.http.impl.HttpClientRequestImpl.end(HttpClientRequestImpl.java:411) 29-May-2023 13:20:18 at io.vertx.ext.web.client.impl.HttpContext.lambda$handleCreateRequest$5(HttpContext.java:485) 29-May-2023 13:20:18 at io.vertx.core.impl.future.FutureImpl$1.onSuccess(FutureImpl.java:91) 29-May-2023 13:20:18 at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) 29-May-2023 13:20:18 at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) 29-May-2023 13:20:18 at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) ``` This is the error ``` java.lang.NullPointerException at io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.OpenTelemetryVertxTracingFactory$Delegator.sendRequest(OpenTelemetryVertxTracingFactory.java:71) ``` And after that the process simply got stuck. And sometimes I get a successful build and tests are ok but next time NPE again. Could you please help me with this ? ### Expected behavior NPE usually means some bug in the code - so at least no NPE ### Actual behavior ``` java.lang.NullPointerException at io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.OpenTelemetryVertxTracingFactory$Delegator.sendRequest(OpenTelemetryVertxTracingFactory.java:71) ``` ### How to Reproduce? Quarkus 3.0.3 app with OpenTelemetry, RESTEasy reactive (perhaps something else) Some @QuarkusTest And simply run it ### Output of `uname -a` or `ver` _No response_ ### Output of `java -version` openjdk version "14" 2020-03-17 OpenJDK Runtime Environment (build 14+36-1461) ### GraalVM version (if different from Java) _No response_ ### Quarkus version or git rev 3.0.3.Final ### Build tool (ie. output of `mvnw --version` or `gradlew --version`) _No response_ ### Additional information _No response_
quarkus-bot[bot] commented 1 year ago

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

ikos23 commented 1 year ago

Seems to be the same issue as reported here https://github.com/quarkusio/quarkus/issues/33285

geoand commented 1 year ago

I'll let @brunobat decide if it's a duplicate or not. If it is, please close and use the triage/duplicate label

brunobat commented 1 year ago

Yes it is a duplicate. Will issue a fix.

brunobat commented 1 year ago

duplicates https://github.com/quarkusio/quarkus/issues/33285