-
Notifications
You must be signed in to change notification settings - Fork 81
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
Received END_STREAM with byte still pending
#386
Comments
That error means that the client is closing an HTTP/2 stream before having sent the full body length that its Without knowing the specifics of the upstream client, this suggests a client error (where the client in this case is your nginx proxy). I would doubt that SSL has anything directly to do with it. Do you have any idea of the size of the payloads in question? Is it possible for you to reproduce this on demand? And if so, is it possible for you to run some capturing functions on the node? |
Hi and thanks for your prompt reply!
I agree, it is not related to SSL, but rather HTTP/2 (which I'm using via HTTPS, h2c is not worth the hassle).
I can reproduce it on demand by quickly reloading the web app multiple times.
Sure! I completely forgot to mention that I'm running in clustered mode with 2 or more Elixir nodes running Phoenix and Bandit. After some more testing, I can say with some confidence that the error occurs when Nginx is switching from one backend server to the other. So it looks like this is an issue with Nginx HTTP/2 proxy handling and not Bandit? |
I enabled 15:41:33.833 [error] ** (Bandit.HTTP2.Errors.StreamError) Received END_STREAM with byte still pending
(bandit 1.5.5) lib/bandit/http2/stream.ex:553: Bandit.HTTPTransport.Bandit.HTTP2.Stream.stream_error!/2
(bandit 1.5.5) lib/bandit/pipeline.ex:185: anonymous fn/1 in Bandit.Pipeline.commit_response!/1
(bandit 1.5.5) lib/bandit/pipeline.ex:40: Bandit.Pipeline.run/4
(bandit 1.5.5) lib/bandit/http2/stream_process.ex:27: Bandit.HTTP2.StreamProcess.handle_continue/2
(stdlib 6.0.1) gen_server.erl:2163: :gen_server.try_handle_continue/3
(stdlib 6.0.1) gen_server.erl:2072: :gen_server.loop/7
(stdlib 6.0.1) proc_lib.erl:329: :proc_lib.init_p_do_apply/3 |
I think I see the issue - if you're not reading the body in your plug, Bandit isn't properly handling the end stream case. Can you try deploying the branch for #387 and see if that resolves your issue?
|
I tried your test branch, and yes - it seems to work! Thank you very much! |
Received END_STREAM with byte still pending
Great! I'll get this out in a release later today |
Published as 1.5.6 |
Hi there,
I'm using Phoenix with Bandit via
PhoenixAdapter
.My application is running in DigitalOcean Kubernetes behind an Nginx Ingress.
Today I wanted to try HTTP/2 proxying with Nginx and Bandit, so I enabled HTTPS on my Phoenix endpoint and HTTPS proxying in Nginx via
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
.From a functionality perspective, everything seems to work fine, but Bandit logs a lot of errors like this:
I haven't found anything about this yet, so I'm not sure what to do. I tried disabling SSL passthrough in Nginx, to no avail.
Here is my Endpoint configuration:
Please let me know if there is any additional information that i could provide :-)
EDIT: Damn, i keep forgetting that:
The text was updated successfully, but these errors were encountered: