quarkusio / quarkus

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

Fungy knative events GET request throws NPE #40676

Open jedla97 opened 1 month ago

jedla97 commented 1 month ago

Describe the bug

When enabling some test in our QE TS a stumble on this error/bug.

When sending request using GET method I get:

Suppressed: java.lang.NullPointerException: Cannot invoke "io.vertx.core.buffer.Buffer.getBytes()" because "this.buffer" is null
                at io.quarkus.funqy.runtime.bindings.knative.events.HeaderCloudEventImpl.data(HeaderCloudEventImpl.java:174)
                at io.quarkus.funqy.runtime.bindings.knative.events.VertxRequestHandler.lambda$processCloudEvent$4(VertxRequestHandler.java:233)
                at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:599)
                at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
                at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
                at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
                at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
                at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
                at java.base/java.lang.Thread.run(Thread.java:833)

The same request using POST work fine.

When trying the funqy-knative-events-quickstart and change one POST method to GET method it fail with error above. Tried older version of Quarkus it wasn't happening. Error start happening in 3.7.0 version. Looking at the git history the GET method wasn't modified for few years so possibly updating vert.x caused this in https://github.com/quarkusio/quarkus/pull/38034 (at least see that post method has changed)

Expected behavior

Work without throwing any error

Actual behavior

Throwing java.lang.NullPointerException: Cannot invoke "io.vertx.core.buffer.Buffer.getBytes()" because "this.buffer" is null

How to Reproduce?

  1. git clone -b fungy-knative-events git@github.com:jedla97/quarkus-reproducers.git
  2. cd quarkus-reproducers
  3. mvn clean verify -Dquarkus.platform.version=3.7.0.CR1

The -Dquarkus.platform.version=3.7.0.CR1 can be switch to -Dquarkus.platform.version=3.10.0

To check that tests passing use -Dquarkus.platform.version=3.6.8 or with 3.2 LTS -Dquarkus.platform.version=3.2.12.Final

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.7.0 and newer

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

No response

Additional information

No response

quarkus-bot[bot] commented 1 month ago

/cc @geoand (knative), @iocanel (knative), @matejvasek (funqy), @patriot1burke (funqy)

geoand commented 3 weeks ago

@patriot1burke can you have a look at this please?