Ask Your Question

S3: method POST on bucket with query delete doesn't work

asked 2018-06-11 23:21:24 -0600

bhaskarsinghal gravatar image

Hello All,

I have uploaded a large object to swift using s3cmd (multipart-upload). But when I tried to delete the bucket(object recursively), the object is not getting deleted:

s3cmd del --recursive --force s3://bucketname

This returns that the objects are deleted, but actually, the objects are not deleted.

DEBUG: format_uri(): /bucketname/?delete
DEBUG: Sending request method_string='POST', uri='/bucketname/?delete', headers={'content-type': 'application/xml', 'Authorization': 'AWS hidden', 'x-amz-date': 'Wed, 06 Jun 2018 20:55:48 +0000', 'content-md5': 'hidden'}, body=(96 bytes)DEBUG: Response: {'status': 200, 'headers': {'content-length': '159', 'x-amz-id-2': 'tx5e61bcccea464480b4cc7-005b184a52', 'x-amz-request-id': 'tx-hidden', 'x-trans-id': 'tx-hidden', 'date': 'Wed, 06 Jun 2018 20:55:47 GMstorageT', 'content-type': 'text/html; charset=UTF-8'}, 'reason': 'OK', 'data': '\n<deleteresult xmlns=""><deleted><key>objectname</key></deleted></deleteresult>';}

s3cmd rb -r --force s3://bucketname
WARNING: Bucket is not empty. Removing all the objects from it first. This may take some time...
delete: 's3://bucketname/objectname
'ERROR: S3 error: 409 (BucketNotEmpty): The bucket you tried to delete is not empty

It looks like handle_delete_iter ( never gets called.

But if I just del the object, then it works and ObjectController.DELETE actually calls handle_delete_iter to delete segments etc.

s3cmd version 1.6.1 OS: Ubuntu 14.04.3 LTS

Any pointers? Does recursive works with del for multi-part uploaded objects?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-01-03 15:01:43 -0600

tburke gravatar image

This might be related to -- you might want to try enabling force_swift_request_proxy_log or just grepping your object-server logs for the DeleteMultiple transaction ID (tx5e61bcccea464480b4cc7-005b184a52). If I'm right about the bug, I'd expect a bunch of HEADs that all 404, so swift3/s3api never follows through with the DELETE.

Another couple things worth looking at: how are your object-updaters doing? Are there a bunch of container updates piling up, so your listings are out of date? How are your replicators and reconstructors doing? Have rebalances moved faster than they should, so data on disk is misplaced?

Does recursive works with del for multi-part uploaded objects?

Yes, it should. That's the purpose of the HEADs -- to figure out whether the object is a multipart upload (in which case the [Swift] DELETE request should include a ?multipart-manifest=delete query param) or a regular object.

edit flag offensive delete link more


In the logs I don't see any HEAD's returning 404, in fact, there are no HEADs for the segment.

bhaskarsinghal gravatar imagebhaskarsinghal ( 2019-01-04 00:03:33 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2018-06-07 12:11:51 -0600

Seen: 196 times

Last updated: Jan 03 '19