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

IllegalStateException: Response has already been written #347

Open
snowdrop-bot opened this issue May 31, 2021 · 0 comments
Open

IllegalStateException: Response has already been written #347

snowdrop-bot opened this issue May 31, 2021 · 0 comments

Comments

@snowdrop-bot
Copy link
Collaborator

Describe the bug

There occasionally occurs an IllegalStateException: Response has already been written when accessing Dev UI or Swagger UI.

Expected behavior

No exception.

Actual behavior

When starting Quarkus in Dev mode and accessing e.g. the Swagger UI, there occasionally occurs an exception in the log file:

2021-05-31 11:59:38,656 ERROR [io.ver.ext.web.RoutingContext] (vert.x-eventloop-thread-11) Unhandled exception in router: java.lang.IllegalStateException: Response has already been written
	at io.vertx.core.http.impl.Http1xServerResponse.end(Http1xServerResponse.java:394)
	at io.vertx.core.http.impl.Http1xServerResponse.end(Http1xServerResponse.java:382)
	at io.vertx.core.http.impl.Http1xServerResponse.end(Http1xServerResponse.java:361)
	at io.quarkus.vertx.http.runtime.QuarkusErrorHandler.handle(QuarkusErrorHandler.java:121)
	at io.quarkus.vertx.http.runtime.QuarkusErrorHandler.handle(QuarkusErrorHandler.java:24)
	at io.vertx.ext.web.impl.RouteState.handleFailure(RouteState.java:1133)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:148)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:205)
	at io.vertx.ext.web.impl.RouterImpl.handleFailure(RouterImpl.java:241)
	at io.vertx.ext.web.impl.RouteState.handleFailure(RouteState.java:1133)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:148)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
	at io.vertx.ext.web.impl.RoutingContextImpl.doFail(RoutingContextImpl.java:588)
	at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:181)
	at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:173)
	at io.vertx.ext.web.impl.RoutingContextWrapper.fail(RoutingContextWrapper.java:100)
	at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendFile$6(StaticHandlerImpl.java:438)
	at io.vertx.core.http.impl.Http1xServerResponse.lambda$null$3(Http1xServerResponse.java:577)
	at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:49)
	at io.vertx.core.impl.DuplicatedContext.emit(DuplicatedContext.java:183)
	at io.vertx.core.http.impl.Http1xServerResponse.lambda$doSendFile$5(Http1xServerResponse.java:577)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
	at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:184)
	at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:95)
	at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:30)
	at io.vertx.core.http.impl.Http1xServerResponse.doSendFile(Http1xServerResponse.java:556)
	at io.vertx.core.http.impl.Http1xServerResponse.sendFile(Http1xServerResponse.java:456)
	at io.vertx.core.http.HttpServerResponse.sendFile(HttpServerResponse.java:431)
	at io.vertx.core.http.HttpServerResponse.sendFile(HttpServerResponse.java:417)
	at io.vertx.ext.web.handler.impl.StaticHandlerImpl.sendFile(StaticHandlerImpl.java:436)
	at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$null$0(StaticHandlerImpl.java:231)
	at io.vertx.ext.web.handler.impl.StaticHandlerImpl.getFileProps(StaticHandlerImpl.java:284)
	at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:208)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:124)
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:832)

To Reproduce

Steps to reproduce the behavior:

  1. Use rest-json-quickstart
  2. Change version to 2.0.0.CR2 and use quarkus-bom
  3. Add quarkus-smallrye-openapi extension
  4. Start Quarkus in Dev mode: mvn quarkus:dev
  5. Open http://localhost:8080/q/swagger-ui/

Environment (please complete the following information):

Output of uname -a or ver

Issue occured both in Linux and WSL (Windows).

Output of java -version

11+

Quarkus version or git rev

2.0.0.CR2

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

Maven 3.6.3


quarkusio#17548


$upstream:17548$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants