Skip to content

bug: require object in abortmp#1289

Merged
fviard merged 2 commits intos3tools:masterfrom
jahschwa:bug/abortmp-require-object
Nov 5, 2022
Merged

bug: require object in abortmp#1289
fviard merged 2 commits intos3tools:masterfrom
jahschwa:bug/abortmp-require-object

Conversation

@jahschwa
Copy link
Copy Markdown

@jahschwa jahschwa commented Nov 4, 2022

Currently, if you only specify a bucket:

s3cmd abortmp s3://mybucket multipartid

Then the request will look like:

DELETE /mybucket/?uploadId=multipartid

In the case of AWS this isn't a huge deal:

ERROR: S3 error: 400 (InvalidRequest): A key must be specified

However, ceph interprets this as a delete bucket request not an abortmp request. If there are any regular objects in the bucket you get:

ERROR: S3 error: 409 (BucketNotEmpty)

But if all you have are incomplete multiparts then ceph actually deletes the bucket.

I intend to open a bug with ceph as well, but since s3cmd isn't following the S3 API spec I still think this PR is useful:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html

Let me know if there's a better approach / I should write a test for this.

@fviard
Copy link
Copy Markdown
Contributor

fviard commented Nov 4, 2022

Thank you very much for your PR.
This is a good catch, and indeed a good thing to fix if it can have bad side effects at least with Ceph :-)

@fviard fviard added this to the 2.4.0 milestone Nov 4, 2022
@jahschwa jahschwa removed their assignment Nov 4, 2022
@jahschwa jahschwa requested a review from fviard November 4, 2022 21:38
@fviard fviard merged commit 0678af4 into s3tools:master Nov 5, 2022
@fviard
Copy link
Copy Markdown
Contributor

fviard commented Nov 5, 2022

Merged, thank you!

@jahschwa jahschwa deleted the bug/abortmp-require-object branch November 7, 2022 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants