-
Notifications
You must be signed in to change notification settings - Fork 125
Error when using HTTP2 for AWS S3 request #602
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
Comments
Given that you have a Charles proxy in the way, can you please print the headers that Charles observes in the HTTP/2 case, and compare that to what it prints for Curl, also running through the proxy? |
Oh, sorry, I see that this doesn't reproduce if you use HTTP/2 through Charles. Can you produce a self-contained sample that I can use to reproduce this issue? |
I am not sure how to produce a self-contained sample... |
I can set up a DigitalOcean Storage bucket for testing purposes, so what I really want is a Soto program that will reproduce the issue against a DO Storage bucket. I can go from there. |
Perfect, I will prepare that 👍 |
friendly ping @pballart |
Hello! Sorry I forgot about this one 😓 |
Thanks for providing the reproducer! This issue is really on Digital Ocean's end, and they should fix it. The problem is that they don't like the HTTP/2 frame sequence we're sending. Specifically, we're producing this request:
We transform this into the following sequence of HTTP/2 frames (formatted in the style of RFC 9113):
That is, we send our HTTP/2 Digital Ocean is incorrectly rejecting this. They want us to drop the Working around this is extremely painful: it would force AHC to remove its reliance on the |
Thanks for the details. I opened a ticket in their support center with a link to this discussion. |
Hi! One of the DigitalOcean Spaces engineers here. Thanks for the reproduction case in https://github.com/pballart/soto-s3-digitalocean. The HTTP/2 stack in use is almost-stock Envoy Proxy. But the problem is a few layers deeper and involves the intersection: we use Ceph for S3 (this has been published and we've given talks about it). Envoy converts HTTP/2 to transfer-encoding chunked for talking to HTTP/1.1 systems. With that in mind, I produced a HTTP/1.1 version of the bug:
AWS gets it correct, Ceph gets it slightly wrong :-(. This behavior has the potential to affect S3 operations that have no payloads. However, some of them DO work... On the plus side, fixing Ceph looks like it would be easy, just a few operations are missing here: As a workaround for now, can you send |
@adam-fowler would this be excessively hard? It's a great fix: swift-nio will automatically behave better in essentially all environments if we do this. |
This would be easy enough. Also @pballart could write a Soto middleware that adds the header in. |
What would be the advantage of writing a middleware instead of adding it by default for all cases? Or is there a case where adding this is not encouraged? |
I only suggested the middleware as it appears the issue will be resolved on Digital Ocean's side and any solution on the client side would only be needed temporarily. |
That makes sense. I'll try the middleware and let you know 👍 |
Me again 😓 You can check it in the content-length-header branch. |
We always remove
You will instead need to set the body to .empty and AHC will set Content-Length: 0 for you. However, we do not set a Content-Length for the methods .GET , .HEAD , .DELETE , .CONNECT or .TRACE as defined in the RFC :
async-http-client/Sources/AsyncHTTPClient/RequestValidation.swift Lines 91 to 105 in fc510a3
There is currently no way to force AHC to send a Content-Length header.
|
This is a time when I begin to wonder whether we need to start having a |
Hi, Just wanted to leave an update here. There turns out to be some gotchas in the "easy" server-side fix I was proposing: That need other changes to ensure security still functions as expected. So it's not going to be as quick as I'd hoped. |
I'm using Soto 7 and AHC 1.21.2, making requests to DigitalOcean Spaces, and some requests (like PutObject) work, but I had to set the configuration to |
Hello! I found an issue while using Vapor 4 and the Soto library to upload and delete objects from a DigitalOcean S3-compatible bucket. After some debugging you can follow in soto-project/soto#608 we arrived at the conclusion that the issue must be in the AsyncHttpClient library.
You can follow the discussion in the linked issue but to sum up:
NotImplemented
error meaning there is some unknown header according to the docs.The text was updated successfully, but these errors were encountered: