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

2.x: SEVERE log statement for a handled problem #7110

Closed
tomas-langer opened this issue Jun 27, 2023 · 1 comment
Closed

2.x: SEVERE log statement for a handled problem #7110

tomas-langer opened this issue Jun 27, 2023 · 1 comment
Assignees
Labels
2.x Issues for 2.x version branch bug Something isn't working P2 webserver

Comments

@tomas-langer
Copy link
Member

Helidon SE
Reported for 2.6.0 (not tested yet against newer versions)

Follow up for #7053 for logging an error even though the problem is handled.

In a simple web server (such as the bare-se generated from Helidon CLI), when the following request is sent:

curl -i -H "Content-Type: %{bad-actor}" http://localhost:8080/greet

The server always prints the following log stement:

SEVERE io.helidon.webserver.RequestRouting Thread[nioEventLoopGroup-3-1,10,main]: Unexpected error occurred during routing!
java.lang.IllegalArgumentException: Could not parse '%{bad-actor}'
	at io.helidon.common.http.MediaType.parse(MediaType.java:360)
	at java.base/java.util.Optional.map(Optional.java:260)
	at io.helidon.webserver.HashRequestHeaders.contentType(HashRequestHeaders.java:82)
	at io.helidon.webserver.Request.<init>(Request.java:90)
	at io.helidon.webserver.RequestRouting$RoutedRequest.<init>(RequestRouting.java:255)
	at io.helidon.webserver.RequestRouting.route(RequestRouting.java:86)
	at io.helidon.webserver.ForwardingHandler.lambda$channelReadHttpRequest$17(ForwardingHandler.java:470)
	at io.helidon.webserver.RequestContext.lambda$runInScope$4(RequestContext.java:77)
	at io.helidon.common.context.Contexts.runInContext(Contexts.java:117)
	at io.helidon.webserver.RequestContext.runInScope(RequestContext.java:75)
	at io.helidon.webserver.ForwardingHandler.channelReadHttpRequest(ForwardingHandler.java:470)
	at io.helidon.webserver.ForwardingHandler.lambda$channelRead0$3(ForwardingHandler.java:166)
	at io.helidon.common.context.Contexts.runInContext(Contexts.java:137)
	at io.helidon.webserver.ForwardingHandler.channelRead0(ForwardingHandler.java:165)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	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:833)

This is wrong, as the error is handled (by default or custom DirectHandler).
We should switch the log level, or remove it and only log on the place where we are 100% sure nobody else will take care of the exception

@Captain1653
Copy link
Contributor

Captain1653 commented Apr 4, 2024

@danielkec The PR for this issue was already merged, but the issue wasn't closed because Fixes-notations works only for main branch. Should this issue be closed?

And the same for the #8029

@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch bug Something isn't working P2 webserver
Projects
Archived in project
Development

No branches or pull requests

5 participants