quarkusio / quarkus

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

Keycloak with quarkus: Response has already been written #41415

Open gilamarko opened 2 weeks ago

gilamarko commented 2 weeks ago

Describe the bug

We are using keycloak 25.0.0 with Quarkus, we have noticed that after a certain ammount of time without restarted the server we are getting some error logs which result in some images not being shown

Expected behavior

Serve the images

Actual behavior

Not serving the images

How to Reproduce?

5T10:08:02.5842291Z 2024-06-25 10:08:02,583 ERROR [io.quarkus.vertx.http.runtime.QuarkusErrorHandler] (executor-thread-81) HTTP Request to /resources/rdu7x/login/keycloakify-starter/build/static/media/logo.463331ec2ea8841b7bb5.png failed, error id: b449f181-2994-4546-82bb-85278943171b-18: java.lang.IllegalStateException: Response has already been written
2024-06-25T10:08:02.5842460Z    at io.vertx.core.http.impl.Http1xServerResponse.checkValid(Http1xServerResponse.java:716)
2024-06-25T10:08:02.5842501Z    at io.vertx.core.http.impl.Http1xServerResponse.exceptionHandler(Http1xServerResponse.java:295)
2024-06-25T10:08:02.5842538Z    at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveOutputStream.<init>(ResteasyReactiveOutputStream.java:46)
2024-06-25T10:08:02.5842576Z    at org.jboss.resteasy.reactive.server.vertx.VertxResteasyReactiveRequestContext.createResponseOutputStream(VertxResteasyReactiveRequestContext.java:457)
2024-06-25T10:08:02.5842613Z    at org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.getOrCreateOutputStream(ResteasyReactiveRequestContext.java:999)
2024-06-25T10:08:02.5842665Z    at io.quarkus.resteasy.reactive.jackson.runtime.serialisers.FullyFeaturedServerJacksonMessageBodyWriter.writeResponse(FullyFeaturedServerJacksonMessageBodyWriter.java:54)
2024-06-25T10:08:02.5842706Z    at org.jboss.resteasy.reactive.server.core.ServerSerialisers.invokeWriter(ServerSerialisers.java:216)
2024-06-25T10:08:02.5842745Z    at org.jboss.resteasy.reactive.server.core.serialization.DynamicEntityWriter.write(DynamicEntityWriter.java:106)
2024-06-25T10:08:02.5842785Z    at org.jboss.resteasy.reactive.server.handlers.ResponseWriterHandler.handle(ResponseWriterHandler.java:32)
2024-06-25T10:08:02.5842825Z    at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:147)
2024-06-25T10:08:02.5842864Z    at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
2024-06-25T10:08:02.5842899Z    at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)
2024-06-25T10:08:02.5842944Z    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
2024-06-25T10:08:02.5842984Z    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
2024-06-25T10:08:02.5843020Z    at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2024-06-25T10:08:02.5843059Z    at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2024-06-25T10:08:02.5843100Z    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2024-06-25T10:08:02.5843136Z    at java.base/java.lang.Thread.run(Thread.java:1583)
2024-06-25T10:08:02.5843170Z 

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

quarkus-bot[bot] commented 2 weeks ago

/cc @pedroigor (keycloak), @sberyozkin (keycloak)

sberyozkin commented 2 weeks ago

@gilamarko You should probably move this issue to the Keycloak project for now, to get a full attention of the Keycloak team, and then, later, if further investigations show a Quarkus fix is necessary, re-open an issue in this project