-
Notifications
You must be signed in to change notification settings - Fork 85
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
truncated responses with H2C (via AWS Application Load Balancer) #392
Comments
For us, it's:
Server logs:
|
From cURL:
|
Thanks! That's super helpful. Any notable logs on the bandit side? |
Nope, nothing from Bandit other than the two request logs. If it's helpful, they're from Logster.Plug and run as a |
I've been trying most of the afternoon to reproduce this and I can't manage to get it working. I can get a repro of a somewhat related issue that I'm noting on a separate comment here, but it manifests as 500s downstream and not truncated responses. It would also be useful to know if:
|
In trying to repro this issue I managed to find a possibly related issue, wherein an ALB target group configured to use HTTP/2 fails to make multiple requests on a single upstream connection. Some details:
Unsure how to investigate this further. Without visibility into ALB's upstream client code, or into the errors it's seeing, we're kinda going blind here. If I had to hunch based on the symptoms at hand it may be related to response header compression contexts, since this is one of the only things shared between streams within in a connection that would affect subsequent streams and not the original one, and also doesn't vary with response size as windows do. |
Got it. It's a header compression bug of some sort, likely upstream in HPAX (or possibly in AWS' HTTP/2 client implementation). Working to characterize it more precisely but it's 100% reproducible. |
Here's a tcpdump capture of a hacked up version of bandit that doesn't return any headers (other than the Now, here's a tcpdump capture of a an otherwise identical version of bandit that adds two copies of the header (FWIW, I've also run tests with another statically defined header ( Of note, wireshark only shows one copy of the |
Fixed it. We were resizing the HPAX compression table contents but not its max size when we received client-side settings frames (this manifests here because the ALB client sets its max header table size to zero as part of its initial settings sync). A hacky fix is up at https://github.com/mtrudel/bandit/tree/aws_investigation if you're so inclined to test. I'm gonna bring this up with @whatyouhide to see if this makes more sense to have as a function on HPAX itself before landing a proper fix on Bandit.
|
I've also failed to switch ALB to h2 when talking to bandit in a very similar setup (ALB to ECS containers) and might be able to test this. |
Can confirm it works in my setup AWS ALB with HTTP/2 enabled for the backend to a target group of ECS containers. |
Great to hear a second opinion! I'm going to keep working it over on HPAX |
My app is using phoenix channels / live_view and upgrade to wss over h2c returns 464. I guess bandit does not support websockets over h2c? |
Correct. RFC 8441 support is coming 'soon' (in fact, most of the refactoring work I've been doing for the past several months has been with the express purpose of supporting it). No promises, but likely some time this winter. |
Sorry, I guess the wording was a bit off, It was not a feature request 🙂 It's a missing piece to support phoenix apps behind a proxy doing TLS termination. |
I recently tried running a Bandit-based Phoenix application with H2C, behind an AWS Application Load Balancer. In this mode, I would almost never receive a full response, even for static files served by
Plug.Static
.Some alternatives which did work, making me thing that the issue is with Bandit's H2C implementation:
I don't have much in the way of logs at the moment, but if there's anything that would be helpful, I'm happy to give it a shot!
The text was updated successfully, but these errors were encountered: