Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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="http://s3.amazonaws.com/doc/2006-03-01/"><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 (bulk.py) 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?

Regards.