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

[Bug] - REST CompleteMultipartUpload - InvalidPart error doesn't include diagnostic parameters #1008

Open
lrm25 opened this issue Dec 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lrm25
Copy link
Contributor

lrm25 commented Dec 30, 2024

Describe the bug
A direct-to-s3 call to CompleteMultipartUpload with an invalid part returns a response like this:

<Error>
  <Code>InvalidPart</Code>
  <Message>One or more of the specified parts could not be found.  The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.</Message>
  <UploadId>woSP7MRqUOq6DDakmxl9eIWurOAp9PVyTXrZ0plUmSpHtni5nZBRuGl6fMRHh53BUwzAhF.T7EoYxOAqhNzA7KnruGbiSvSbfsymFlJom95qHDO4Q3hPQFWFxKANi87N</UploadId>
  <PartNumber>1</PartNumber>
  <ETag>gibberish</ETag>
  <RequestId>HKCGS5PTX4HGSMP9</RequestId>
  <HostId>DhvkCqhi6vyd8giple6BIxVEAqSycOK7qUoqTRv9kUt4CZArqZrfFYANFIjsv/QZxnXVCaQUKtY=</HostId>
</Error>

The versitygw response doesn't include the UploadId, PartNumber, or ETag.

To Reproduce

  1. Start versitygw, e.g.: ./versitygw --access=AKIA**** --secret=******** --region=us-east-1 --iam-dir=/Users/lukemccrone/devel/versitygw/iam --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
  2. Create a bucket, e.g.: aws --no-verify-ssl s3api create-bucket --bucket versity-gwtest-bucket-one-1
  3. Create a large file, and split into 4 parts.
  4. Upload each part to the bucket, e.g.: aws --no-verify-ssl s3api put-object --body /Users/lukemccrone/devel/versitygw/versity-gwtest-files/test_file-0 --bucket versity-gwtest-bucket-one-1 --key test_file-0 for each part.
  5. Create multipart upload with REST script, e.g.: curl -ks -w %{http_code} -X POST https://localhost:7070/versity-gwtest-bucket-one-1/test_file?uploads= -H Authorization: AWS4-HMAC-SHA256 Credential=********/20241230/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=a1d2efbea7f887a54ef66138f2b5924d118db5e6ba82f7e4d763f32a458071c8 -H x-amz-content-sha256: UNSIGNED-PAYLOAD -H x-amz-date: 20241230T170902Z -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/output.txt
  6. Run UploadPartCopy with upload_part_copy.sh script, e.g.: curl -ks -w %{http_code} -X PUT https://localhost:7070/versity-gwtest-bucket-one-1/test_file?partNumber=1&uploadId=a14dcaa0-8005-4ed5-8635-9f53d21a24a5 -H Authorization: AWS4-HMAC-SHA256 Credential=********/20241230/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-copy-source;x-amz-date,Signature=6eaad4416632bcb559c392b53ff1bec07742ad75fb50f60c5c0c3fd618bef5cb -H x-amz-content-sha256: UNSIGNED-PAYLOAD -H x-amz-copy-source: versity-gwtest-bucket-one-1/test_file-0 -H x-amz-date: 20241230T170902Z -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/response.txt for each part.
  7. Attempt to complete upload with inaccurate ETag, e.g.: curl -ks -w %{http_code} -X POST https://localhost:7070/versity-gwtest-bucket-one-1/test_file?uploadId=a14dcaa0-8005-4ed5-8635-9f53d21a24a5 -H Authorization: AWS4-HMAC-SHA256 Credential=********/20241230/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=01bda6b17fc5c6b3c6d873de87e7cb6205e7b966024b2351f76be0b91bfd8937 -H x-amz-content-sha256: 5d5039c11d235c65c32999adf7a3e63242979e04722af1e3ffa54e6f49d45a31 -H x-amz-date: 20241230T170903Z -H Content-Type: application/xml -d <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Part><ETag>gibberish</ETag><PartNumber>1</PartNumber></Part><Part><ETag>gibberish</ETag><PartNumber>2</PartNumber></Part><Part><ETag>gibberish</ETag><PartNumber>3</PartNumber></Part><Part><ETag>gibberish</ETag><PartNumber>4</PartNumber></Part></CompleteMultipartUpload> -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/result.txt

Expected behavior
As with direct, UploadId, PartNumber, and ETag are shown.

Server Version
Version : v1.0.9
Build : bf20fa7
BuildTime: 2024-12-26_03:50:17PM
Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64

@lrm25 lrm25 added the bug Something isn't working label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant