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

More descriptive failure messages in HttpMessageParser #396

Closed
SkyTrix opened this issue Jan 3, 2024 · 1 comment
Closed

More descriptive failure messages in HttpMessageParser #396

SkyTrix opened this issue Jan 3, 2024 · 1 comment

Comments

@SkyTrix
Copy link
Contributor

SkyTrix commented Jan 3, 2024

I'm currently investigating an issue where we're suddenly running into the following error: HTTP chunk size exceeds the configured limit of 1048576 bytes.

This is possibly due to an infrastructure change we made which results in a change of behavior when chunked transfer encoding is used. I did not find a way to determine the actual size of the incoming chunks and it would be really helpful if it was part of that error message.

My proposal here would be to extend all relevant errors in HttpMessageParser with extra parameter values. e.g. for the max chunk size, the full hex size could be read before validating against maxChunkSize and then including the size parameter in the error message:

https://github.com/apache/incubator-pekko-http/blob/4f80b1ef7cad2833382a659e7dd0b1a54078d126/http-core/src/main/scala/org/apache/pekko/http/impl/engine/parsing/HttpMessageParser.scala#L309-L320

Given that on line 318 the actual encountered illegal char is part of the error message, I think having the size in the other error is warranted. Apart from max chunk size there are a few other messages that could be improved such as max chunk extensions and amount of chunk trailer headers.

Any thoughts on this proposal?

SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
SkyTrix added a commit to SkyTrix/pekko-http that referenced this issue Mar 28, 2024
Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.
pjfanning pushed a commit that referenced this issue Mar 31, 2024
* Parse entire HTTP chunk size #396

Continue parsing HTTP chunk size up until Int.MaxValue so the actual
size of the chunk can be logged if it exceeds the configured max chunk
size.

* Add reference to Integer.MAX_VALUE in the error message

* Fix formatting
@pjfanning
Copy link
Contributor

probably should have been closed after #528 was merged

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

No branches or pull requests

2 participants