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

Uncaught exceptions in io.jooby.internal.netty.NettyHandler.offer #3580

Closed
tpoll opened this issue Nov 11, 2024 · 2 comments
Closed

Uncaught exceptions in io.jooby.internal.netty.NettyHandler.offer #3580

tpoll opened this issue Nov 11, 2024 · 2 comments
Milestone

Comments

@tpoll
Copy link
Contributor

tpoll commented Nov 11, 2024

We are seeing several instances of uncaught exceptions from https://github.com/jooby-project/jooby/blob/3.x/modules/jooby-netty/src/main/java/io/jooby/internal/netty/NettyHandler.java#L175.

For example, we are seeing the underlying Netty decoder throw exceptions like HttpPostRequestDecoder$TooLongFormFieldException , there also seem to be some underlying NPEs in netty like:

NullPointerException
Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "delimiter" is null

io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in readDelimiterOptimized at line 1116
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in findMultipartDelimiter at line 699
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in decodeMultipart at line 541
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in parseBodyMultipart at line 506
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in parseBody at line 472
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in offer at line 384
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder in offer at line 55
io.jooby.internal.netty.NettyHandler in offer at line 175
...

is there any appetite for have the jooby code be more defensive here about uncaught exceptions and translating them into http status codes?

@jknack
Copy link
Member

jknack commented Nov 12, 2024

would you like to send a PR?

@tpoll
Copy link
Contributor Author

tpoll commented Nov 13, 2024

yes, I can send a PR later this week.

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