When using lazy JWT authentication with http permissions observing below exceptions if JWT token in the request is expired.
[io.ver.ext.web.RoutingContext] (vert.x-eventloop-thread-22) Unhandled exception in router: java.lang.IllegalStateException: Response head already sent
or
[io.ver.ext.web.RoutingContext] (vert.x-eventloop-thread-0) Unhandled exception in router: java.lang.IllegalStateException: Response has already been written
2021-08-24 17:00:00,950 ERROR [io.ver.ext.web.RoutingContext] (vert.x-eventloop-thread-22) Unhandled exception in router: java.lang.IllegalStateException: Response head already sent
at io.vertx.core.http.impl.Http1xServerResponse.checkHeadWritten(Http1xServerResponse.java:675)
at io.vertx.core.http.impl.Http1xServerResponse.setStatusCode(Http1xServerResponse.java:144)
at io.quarkus.vertx.http.runtime.QuarkusErrorHandler.handle(QuarkusErrorHandler.java:77)
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.RoutingContextImpl.doFail(RoutingContextImpl.java:591)
at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:184)
at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:173)
at io.quarkus.vertx.http.runtime.security.HttpAuthorizer$3.accept(HttpAuthorizer.java:140)
at io.quarkus.vertx.http.runtime.security.HttpAuthorizer$3.accept(HttpAuthorizer.java:137)
Observed below exception as well though not able to reproduce it always
2021-08-24 14:02:19,090 ERROR [io.ver.ext.web.RoutingContext] (vert.x-eventloop-thread-0) Unhandled exception in router: java.lang.IllegalStateException: Response has already been written
at io.vertx.core.http.impl.Http1xServerResponse.checkValid(Http1xServerResponse.java:669)
at io.vertx.core.http.impl.Http1xServerResponse.endHandler(Http1xServerResponse.java:310)
at io.vertx.ext.web.impl.RoutingContextImpl.getEndHandlers(RoutingContextImpl.java:573)
at io.vertx.ext.web.impl.RoutingContextImpl.addEndHandler(RoutingContextImpl.java:436)
at io.quarkus.vertx.web.runtime.RouteHandler.handle(RouteHandler.java:90)
at io.quarkus.vertx.web.runtime.RouteHandler.handle(RouteHandler.java:22)
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:591)
at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:184)
at io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:173)
at io.quarkus.vertx.http.runtime.security.HttpAuthorizer$3.accept(HttpAuthorizer.java:140)
at io.quarkus.vertx.http.runtime.security.HttpAuthorizer$3.accept(HttpAuthorizer.java:137)
Describe the bug
When using lazy JWT authentication with http permissions observing below exceptions if JWT token in the request is expired.
Quarkus Extensions used: cdi, security, smallrye-context-propagation, smallrye-jwt, smallrye-openapi, swagger-ui, vertx, vertx-web
Config used:
Expected behavior
No Runtime exceptions
Actual behavior
Observing below exception
Observed below exception as well though not able to reproduce it always
How to Reproduce?
https://github.com/MM87037/routing-error
Start the service and run below command
or Run maven build
Output of
uname -a
orver
Windows 10 Git Bash or Linux ids-slpdf-service-117-qd7hx 3.10.0-1160.36.2.el7.x86_64 #1 SMP Thu Jul 8 02:53:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.12" 2021-07-20
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.0 and above
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven 3.8.1
Additional information
No response
https://github.com/quarkusio/quarkus/issues/19621
$upstream:19621$