-
Notifications
You must be signed in to change notification settings - Fork 39
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
S3 Put object request returned has "Etag" in metadata, which does not work with aws-sdk-java putObject API #67
Comments
Anyone successfully use Swift3 with Amazon S3 Java SDK? |
This is caused from a problem of eventlet which is a WSGI library of python.
i.e. currently, we have no way to prevent that eventlet converts "ETag" into "Etag". |
Opened a issue on Eventlet project : eventlet/eventlet#80 |
Hello. Please, see this resolution on behalf of Eventlet. With great respect. Hello, @asramakanth . Thank you for your message. As per HTTP standard, header names are case-insensitive. That means, with Eventlet or any other software, you could receive any of "etag", "ETAG" or "eTAg" and they all MUST work the same way.
Consider there may be other users who also ignore HTTP standard and expect current header name case, "Etag". Suppose we fix the issue in your favor, then it would break some other code. Clean solution is to ignore header name case. Usually people do this by converting all header names to lower case ("etag") and searching for those strings. |
Implementation of AWS S3 violates many HTTP specs (even violate S3 spec itself!!), and many S3 clients follow it. If what you want is to claim that your product is fully compatible with AWS S3, you should violate spec, and hacking current HTTP framework/library, too. |
Okay, could anyone please explain software actors involved in this problem, where and when Eventlet comes into play and changes (if?) headers? |
@temoto, Software actors are AWS S3 Java SDK, Swift3, and Eventlet. |
I'm not sure but I've confirmed the behavior at Eventlet 0.9.17. |
I mean what are the steps to reproduce the problem? I am not familiar with Swift, AWS SDK and only briefly know that OpenStack is API compatible open source version of AWS. |
There are 2 ways (perhaps and more) to fix. One way is ignoring case when getting metadata as below: The other is making eventlet allow any case headers such as "ETag" and then adding "ETag" instead of "Etag" on swift3. Does it make you sense? |
Did not expect AWS Java SDK to be open source and even on github. It makes much more sense to patch it, then. The only problem then is frozen package versions in distributions. And in parallel, we could allow |
Please, try this eventlet/eventlet@0433029 |
@temoto, what are the steps to apply your fix in an existing swift3 setup? Directly patching the file? |
Yes, you could patch the file or use virtualenv and |
Also you need to add |
Here's a nice reminder. Please, try fixed eventlet version above and report if the issue is fixed. |
Hi @temoto, I've confirmed that your patch fixes the problem. Thanks a lot! For swift3 users, please note that we also need a patch for Swift |
Thanks for reply. The fix is merged into eventlet master eventlet/eventlet@e4dedf7 and will be included in the next release (v0.15). |
What swift3 official release will have this fix? So that our QA can pick up that release to test. Thanks From: Sergey Shepelev <notifications@github.commailto:notifications@github.com> Thanks for reply. The fix is merged into eventlet master eventlet/eventlet@e4dedf7eventlet/eventlet@e4dedf7 and will be included in next release (v0.15). — |
Has this fix in swift been merged into swift trunk? Or any official release support this. Thank you |
@Kuruvi |
@bloodeagle40234 |
@Kuruvi |
In invoking AWS S3 java API against Swift, we failed with the following NPE
java.lang.NullPointerException
at com.amazonaws.util.BinaryUtils.fromHex(BinaryUtils.java:69)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1140)
at com.cloud.utils.S3Utils.putObject(S3Utils.java:178)
After investigation, we realized that Amazon S3 expects that returned metadata should have "ETag" as the metadata key, but the metadata returned from Swift3 has "Etag" as the key, thus causing this NPE. Here is the returned metadata from Swift3:
{Content-Length=0, Etag="5e714348185ffe355a76b754f79176d6", X-Trans-Id=tx1b475494fc1e41049a8be-00530fc274, Content-Type=text/html; charset=UTF-8, Connection=keep-alive}
The text was updated successfully, but these errors were encountered: