question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resteasy "connection was closed" error after upgrading to 2.4.x

See original GitHub issue

Describe the bug

After bumping the Quarkus version to 2.4.x (tested 2.4.0.Final, 2.4.1.Final, and 2.4.2.Final) in Keycloak, the following error is happening every time you reload a page multiple times during a short period (e.g.: holding F5 when at the browser):

2021-11-28 17:51:03,913 ERROR [org.jbo.thr.errors] (executor-thread-4) Thread Thread[executor-thread-4,5,main] threw an uncaught exception: java.lang.RuntimeException: java.io.IOException: j
ava.io.IOException: io.vertx.core.VertxException: Connection was closed
        at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse.vertxFlush(VertxHttpRequest.java:396)
        at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse$1.run(VertxHttpRequest.java:326)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: java.io.IOException: io.vertx.core.VertxException: Connection was closed
        at io.quarkus.resteasy.runtime.standalone.VertxOutputStream.close(VertxOutputStream.java:124)
        at io.quarkus.resteasy.runtime.standalone.VertxHttpResponse.finish(VertxHttpResponse.java:145)
        at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse.vertxFlush(VertxHttpRequest.java:394)
        ... 8 more
Caused by: java.io.IOException: io.vertx.core.VertxException: Connection was closed
        at io.quarkus.resteasy.runtime.standalone.VertxBlockingOutput.write(VertxBlockingOutput.java:79)
        at io.quarkus.resteasy.runtime.standalone.VertxHttpResponse.writeBlocking(VertxHttpResponse.java:172)
        at io.quarkus.resteasy.runtime.standalone.VertxOutputStream.close(VertxOutputStream.java:122)
        ... 10 more
Caused by: io.vertx.core.VertxException: Connection was closed

The error does not happen if we downgrade to version 2.3.1.

Expected behavior

No errors in logs if loading a page multiple times.

Actual behavior

Errors are shown in logs as per description.

How to Reproduce?

I’m did not work yet a reproducer but the error is very easy to reproduce by following these steps:

  1. Build Keycloak.X Distribution with pom.xml in quarkus package set to 2.5.0.Final (and postgres to 42.3.1), use e.g. mvn clean install -DskipTests -Pdistribution in root directory (or see readme here: https://github.com/keycloak/keycloak/tree/main/quarkus ).
  2. unpack zip from distribution/server-x-dist/target
  3. cd /bin
  4. run ./kc.sh start-dev
  5. Using a browser, reload the page multiple times during a very short period of time

Output of uname -a or ver

Linux fedora 5.14.18-200.fc34.x86_64 #1 SMP Fri Nov 12 16:48:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version “11.0.13” 2021-10-19 OpenJDK Runtime Environment 18.9 (build 11.0.13+8) OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.4.2.Final

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

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
pedroigorcommented, Nov 29, 2021

@geoand Works with 2.5.0.Final and also with the latest 999-SNAPSHOT. I’m still running tests though but I could not reproduce the error so far using those versions.

I’m afraid we are going to need to wait for 2.5.1 before we release KC v16.

Thanks.

1reaction
geoandcommented, Dec 6, 2021

Thanks for the reproducer.

I opened https://github.com/quarkusio/quarkus/pull/21942 to handle it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resteasy Client keeping connection allocated after a method ...
But a problem happens when any of the called methods throws an Exception: the Reasteasy Client becomes "lost" and still holds the connection,...
Read more >
3. Resolved and Known Issues Red Hat JBoss Enterprise ...
An attempt to query the patch status of a JBoss EAP instance could previously result in an IllegalStateException error being thrown.
Read more >
Upgraded to wildfly-24.0.0.Final & deployed EAR with this error
as.txn] (ServerService Thread Pool -- 80) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value.
Read more >
Known issues - PaperCut
Print Deploy Client may show "Can't reach this page" error on Windows ... and you're upgrading the client from 18.x or before, to...
Read more >
Upgrading from Resteasy 2 to Resteasy 3 - JBoss.org
In particular, those classes are deprecated by the end of the 3.0.x series of ... Resteasy 2 had two facilities for handling errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found