Closed ginccc closed 9 months ago
From the stack trace it is hard to see what's going on. I'm a bit concerned that the epoll wait is done on the event loop - this is definitely not right. But it's hard to say from where it comes.
I would recommend switching to resteasy reactive.
thanks for the feedback. Switching to resteasy reactive is a good idea, but will take some time to do. In the meantime, what else can we do? This is a base quarkus functionality and the container's sudden break in readiness and inability to recover from it is deeply concerning.
We would need a standalone minimal reproducer to see what's going on. For sure epoll from the event loop is incorrect.
Unfortunately it only happened twice in the last few months.. Unsure what event causes it.
Unfortunately, without a reproducer, it's impossible to understand what's going on.
we have updated to resteasy-reactive & rest-client-reactive like suggested. We will observe it to see if this issue appears again with the reactive components. If so, we'll report it here again. I am just worried that the best we will be getting is the very same stack trace from above, so not sure how we can improve the error report the next time around.
You have a dependency on infinispan, which also use netty. Why not using the extension? The issue may comes from an interaction with something that is not correctly integrated.
From what I know the quarkus extension for infinispan covers only the client but doesn't allow infinispan to run embedded..
I have potentially more information around this issue, as the last time i saw it happening it appeared after an InterruptedException that was triggered due to a configured timeout.
Caused by: java.lang.InterruptedException
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:386)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
... 20 more
2023-12-14 15:54:25 ERROR [io.ver.ext.web.RoutingContext]] (vert.x-eventloop-thread-1) Unhandled exception in router
2023-12-14 19:48:23 ERROR [io.ver.ext.web.RoutingContext]] (vert.x-eventloop-thread-1) Unhandled exception in router
2023-12-14 19:48:23 ERROR [io.ver.ext.web.RoutingContext]] (vert.x-eventloop-thread-0) Unhandled exception in router
Unfortunately, I need a minimal standalone reproducer to investigate the issue.
Closing for lack of a reproducer
@geoand I've also faced with the same problem.
here is my TRACE
log of the same thread before this error message occurs:
2024-02-04 13:46:03.235+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.237+08:00 | vert.x-eventloop-thread-1 | TRACE | RouterImpl | Router: 19149411 accepting request POST http://172.16.0.5:8549/ 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Route matches: RouteState{metadata=null, path='null', name=null, order=1, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService$$Lambda$886/0x00007f0a84515228@5f7f834e], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true} 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | DEBUG | B3PropagatorExtractorMultipleHeaders | Invalid TraceId in B3 header: null'. Returning INVALID span context. 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Route matches: RouteState{metadata=null, path='null', name=null, order=2, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService$$Lambda$887/0x00007f0a84515450@196f6366], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true} 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Route matches: RouteState{metadata=null, path='null', name=null, order=3, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.vertx.ext.web.handler.impl.CorsHandlerImpl@1edc9f0a], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true} 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Route matches: RouteState{metadata=null, path='null', name=null, order=4, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.vertx.ext.web.handler.impl.BodyHandlerImpl@6389e44b], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true} 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Route matches: RouteState{metadata=null, path='/', name=null, order=8, enabled=true, methods=[POST], consumes=null, emptyBodyPermittedWithConsumes=false, produces=[io.vertx.ext.web.impl.ParsableMIMEValue@fd630a66], contextHandlers=[org.hyperledger.besu.ethereum.api.handlers.JsonRpcParserHandler$$Lambda$897/0x00007f0a8451a080@3495725e, org.hyperledger.besu.ethereum.api.handlers.TimeoutHandler$$Lambda$900/0x00007f0a8451a930@582c0f2a, io.vertx.ext.web.impl.BlockingHandlerDecorator@555d6c07], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=true, exclusive=false, exactPath=true} 2024-02-04 13:46:03.238+08:00 | vert.x-eventloop-thread-1 | TRACE | RoutingContext | Calling the handler 2024-02-04 13:46:03.949+08:00 | vert.x-eventloop-thread-1 | ERROR | RoutingContext | Unhandled exception in router
My scenario is that we use blockscout to call besu for some block data to built explorer and something went wrong when acquiring data.
Since TRACE
is currently the most verbose log of besu and we still could not find any useful info, I recommend to improve the log.
I've checked the RoutingContextImplBase.java(who print this error log)
in vertx as well as JsonRpcHttpService.java
in besu.
in RoutingContextImplBase.java(who print this error log)
, it failed to find appropriate handlers:
Handler<RoutingContext> errorHandler = router.getErrorHandlerByStatusCode(code);
if (errorHandler != null) {
try {
errorHandler.handle(this);
} catch (Throwable t) {
LOG.error("Error in error handler", t);
}
} else {
// if there are no user defined handlers, we will log the exception
LOG.error("Unhandled exception in router", failure);
}
Maybe we could add more handlers for other http error code in besu:
private Router buildRouter() {
// Handle json rpc requests
final Router router = Router.router(vertx);
router.route().handler(this::createSpan);
// Verify Host header to avoid rebind attack.
router.route().handler(checkAllowlistHostHeader());
router.errorHandler(403, new Logging403ErrorHandler());
.....
@iampkuhz if you could attach a sample application that behaves as you describe, we can look into it more
I got very similar issue, which was triggered by nessus scan which sending a bad request - null authority/path, and it was catched by RoutingContextImpl in vertx-web. Workaround for me is adding error handler for 400/404:
void init(@Observes Router router) {
router.errorHandler(400, ctx -> {});
}
It won't work if your http root-path is not "/", because VertxHttpRecoder only notify http router and main router will be same as http router if root-path is "/".
Not sure VertxHttpRecoder can also notify main router?
Which Quarkus version are you using? We had a bug with http requests without host header.
Which Quarkus version are you using? We had a bug with http requests without host header.
hi @cescoffier 3.14.2
Try with 3.15. Do you know the HTTP version for the request without host?
Try with 3.15. Do you know the HTTP version for the request without host?
HTTP_1_0
Host is not mandatory in HTTP 1. So it should work.
A reproducer would be super useful
Host is not mandatory in HTTP 1. So it should work.
A reproducer would be super useful
Upgrade to 3.15 seem to fix the issue with HTTP_1_0 request as it(RoutingContextImpl) add checking for version, but not really fix the issue as request can be http 1.1
Here is my http request to reproduce the issue:
GET http://localhost:1024/test
Accept: application/json
Content-Type: */*
host:[localhost:1024
Http 1.1 considers the host header as mandatory. So, if the request does not have it, it's an invalid http request.
Describe the bug
We have been experiencing this exception for the second time, however, we cannot reproduce it.
It is unclear when it happens and how to avoid it. It is fatal tough as the container doesn't recover from it. However, rest endpoints appear to be still reachable, so it could be related to the mongoDB database connection, but there is no direct indication for that. Vert.x is not directly used anywhere in the business logic, but powers quarkus of course.
Any ideas what we can do about it?
Quarkus: 3.6.1 (but was a problem at least for 3.5.3 as well) Code base of the container that has this issue: https://github.com/labsai/EDDI
pom.xml
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response