http2 not returning 413 when streaming #3191
Answered
by
karpetrosyan
DeoLeung
asked this question in
Potential Issue
-
when i do res = await self.send(req, stream=True) if using http2, the request hangs till timeout 2024-05-05 08:27:53,672 _trace:15373 DEBUG send_request_body.started request=<Request [b'POST']> stream_id=1
2024-05-05 08:27:53,713 _trace:15373 DEBUG receive_remote_settings.started
2024-05-05 08:27:53,713 _trace:15373 DEBUG receive_remote_settings.complete return_value=<RemoteSettingsChanged changed_settings:{ChangedSetting(setting=3, original_value=None, new_value=128), ChangedSetting(setting=4, original_value=65535, new_value=65536), ChangedSetting(setting=5, original_value=16384, new_value=16777215)}>
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoding b" H\x03413v\x84\xaacU\xe7a\x96\xddm_J\x01\xb54\x0f\xd2\x82\x00\x9aP\x00\xb8'n6\xca\x98\xb4o_\x87I|\xa5\x89\xd3M\x1f\\\x03176"
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 0, consumed 1 bytes
2024-05-05 08:27:53,714 table:15373 DEBUG Resizing header table to 0 from 4096
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 8, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 3, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded (b':status', <memory at 0x16a9dc400>), total consumed 5 bytes, indexed True
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 54, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 4, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded (b'server', b'nginx'), total consumed 6 bytes, indexed True
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 33, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 22, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded (b'date', b'Sun, 05 May 2024 00:27:53 GMT'), total consumed 24 bytes, indexed True
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 31, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 7, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded (b'content-type', b'text/html'), total consumed 9 bytes, indexed True
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 28, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded 3, consumed 1 bytes
2024-05-05 08:27:53,714 hpack:15373 DEBUG Decoded (b'content-length', <memory at 0x16a9dce80>), total consumed 5 bytes, indexed True I disable http2, and it returns correctly with 413 2024-05-05 08:29:01,408 _trace:15745 DEBUG receive_response_headers.started request=<Request [b'POST']>
2024-05-05 08:29:01,409 _trace:15745 DEBUG receive_response_headers.complete return_value=(b'HTTP/1.1', 413, b'Request Entity Too Large', [(b'Server', b'nginx'), (b'Date', b'Sun, 05 May 2024 00:29:01 GMT'), (b'Content-Type', b'text/html'), (b'Content-Length', b'176'), (b'Connection', b'close')])
2024-05-05 08:29:01,410 _client:15745 INFO HTTP Request: POST abcd "HTTP/1.1 413 Request Entity Too Large"
2024-05-05 08:29:01,410 _trace:15745 DEBUG receive_response_body.started request=<Request [b'POST']>
2024-05-05 08:29:01,410 _trace:15745 DEBUG receive_response_body.complete
2024-05-05 08:29:01,410 _trace:15745 DEBUG response_closed.started
2024-05-05 08:29:01,410 _trace:15745 DEBUG response_closed.complete
2024-05-05 08:29:01,410 __init__:15745 ERROR upstream failed with 413 <html> it took me quite a while to find out that I need to fix nginx setting. is it an http2 bug? |
Beta Was this translation helpful? Give feedback.
Answered by
karpetrosyan
May 5, 2024
Replies: 1 comment 2 replies
-
I think it's related to encode/httpcore#777. We need to get it merged in order to handle 413 correctly for http2 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
DeoLeung
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it's related to encode/httpcore#777. We need to get it merged in order to handle 413 correctly for http2