Skip to content
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

S3Client::CompleteMultipartUpload returns success for failed requests #658

Closed
dyfrgi opened this issue Sep 12, 2017 · 15 comments
Closed

S3Client::CompleteMultipartUpload returns success for failed requests #658

dyfrgi opened this issue Sep 12, 2017 · 15 comments
Assignees
Labels
automation-exempt This issue will not be closed by autoclose action bug This issue is a bug. needs-review This issue or pull request needs review from a core team member.

Comments

@dyfrgi
Copy link

dyfrgi commented Sep 12, 2017

Complete Multipart Upload is a bit weird in the REST API. Rather than return a failed HTTP code for a failure, it returns 200 OK immediately and then may later, at its leisure, send back an error. This is described in the API docs here:
http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html

However, if an error is received for a Complete Multipart Upload along with a 200 OK, as described in the example given in the doc there, the CompleteMultipartUploadOutcome returned by S3Client::CompleteMultipartUpload will have have IsSuccess()==true.

We are specifically receiving 200 OK SlowDown errors, but I expect other errors may occur as there's one given as an example in the API doc.

@JonathanHenson JonathanHenson added the bug This issue is a bug. label Sep 12, 2017
@JonathanHenson
Copy link
Contributor

Thanks for reporting will get it queued up for fix.

@marcomagdy
Copy link
Contributor

This has been fixed in v1.3.30

@marcomagdy
Copy link
Contributor

We'll have to revert this change f5c0f79 See #781 for more details.

@andriy-bulynko
Copy link

Hi! We're hitting this bug as well. Do you have any idea when you might post a fix? Thanks!

@KaibaLopez KaibaLopez added the automation-exempt This issue will not be closed by autoclose action label Aug 6, 2020
@KaibaLopez KaibaLopez added the needs-review This issue or pull request needs review from a core team member. label Aug 23, 2021
@pitrou
Copy link

pitrou commented Oct 30, 2021

Why isn't this still fixed? This sounds like a critical bug. We just got word that our users can be hit by it: https://issues.apache.org/jira/browse/ARROW-14523

@pitrou
Copy link

pitrou commented Oct 30, 2021

@pitrou
Copy link

pitrou commented Oct 30, 2021

I'll also note that the docstring, while stating the problem, is unhelpful as to how to solve it:

Processing of a Complete Multipart Upload request could take several minutes to complete. After Amazon S3 begins processing the request, it sends an HTTP response header that specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white space characters to keep the connection from timing out. Because a request could fail after the initial 200 OK response has been sent, it is important that you check the response body to determine whether the request succeeded.

pitrou added a commit to pitrou/arrow that referenced this issue Nov 2, 2021
Work around a critical bug in the AWS SDK for C++ that fails to detect errors
returned by CompleteMultipartUpload in the body of a 200 OK response:
aws/aws-sdk-cpp#658
pitrou added a commit to pitrou/arrow that referenced this issue Nov 3, 2021
Work around a critical bug in the AWS SDK for C++ that fails to detect errors
returned by CompleteMultipartUpload in the body of a 200 OK response:
aws/aws-sdk-cpp#658
pitrou added a commit to pitrou/arrow that referenced this issue Nov 4, 2021
Work around a critical bug in the AWS SDK for C++ that fails to detect errors
returned by CompleteMultipartUpload in the body of a 200 OK response:
aws/aws-sdk-cpp#658
@pitrou
Copy link

pitrou commented Nov 4, 2021

Our own workaround is to intercept XML error response using a DataReceivedHandler. Unfortunately, we can't really test it (those errors seem quite sporadic), but it should theoretically work.

pitrou added a commit to apache/arrow that referenced this issue Nov 4, 2021
Work around a critical bug in the AWS SDK for C++ that fails to detect errors returned by CompleteMultipartUpload in the body of a 200 OK response:
aws/aws-sdk-cpp#658

Closes #11594 from pitrou/ARROW-14523-s3-cmu-error-fix

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@sdavtaker sdavtaker self-assigned this Nov 4, 2021
@sdavtaker
Copy link
Contributor

It seems like the Bug in TinyXML2 was resolved and we recently and we should be able to merge this fix again.

@pitrou
Copy link

pitrou commented Nov 4, 2021

As a sidenote, the original fix seems costly if it blindly parses any HTTP response (even a huge binary payload) as XML.

kszucs pushed a commit to apache/arrow that referenced this issue Nov 4, 2021
Work around a critical bug in the AWS SDK for C++ that fails to detect errors returned by CompleteMultipartUpload in the body of a 200 OK response:
aws/aws-sdk-cpp#658

Closes #11594 from pitrou/ARROW-14523-s3-cmu-error-fix

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@pitrou
Copy link

pitrou commented Nov 15, 2021

So, here is an example of how this could be fixed in the AWS SDK, IMHO:

  • add a method virtual bool HasEmbeddedError(Aws::IOStream& body, Aws::Client::AWSError<Aws::Client::CoreErrors>* error) in AmazonWebServiceRequest; default implementation returns false and leaves error unchanged
  • override that method in CompleteMultipartUploadRequest and make it parse the XML payload for embedded errors
  • in AttemptOneRequest, call HasBodyError for successfull HTTP responses

@sdavtaker
Copy link
Contributor

Thanks @pitrou for the proposed solution, it sounds like a good approach.

@jvictor0
Copy link

I agree with @pitrou that this is a critial issue. Our customers seem to have hit it as well.

@sbiscigl
Copy link
Contributor

the fix has been merged and will be released with 1.9.333

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation-exempt This issue will not be closed by autoclose action bug This issue is a bug. needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

No branches or pull requests

9 participants