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

rm doesn't delete 0-byte folder placeholders #707

Open
iainelder opened this issue Feb 28, 2024 · 0 comments
Open

rm doesn't delete 0-byte folder placeholders #707

iainelder opened this issue Feb 28, 2024 · 0 comments

Comments

@iainelder
Copy link

I expect these commands to empty and then delete bucket1.

s5cmd rm --all-versions "s3://bucket1/*"
s5cmd rb "s3://bucket1"

Instead the rb operation failed because the bucket is still not empty.

ERROR "rb s3://bucket1": BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: ..., host id: ...

I check what objects remain.

aws s3api list-objects-v2 --bucket hg-mediadata-inventory | jq -c '.Contents[] | {Key, Size}'

The bucket still contains 0-byte objects that act as "folder" placeholders.

{"Key":"bucket2/inventory1/data/","Size":0}
{"Key":"bucket3/inventory1/data/","Size":0}
{"Key":"bucket4/inventory1/data/","Size":0}
...

The S3 inventory service created the keys. bucket1 stores inventory snapshots for the other buckets in the account.

Whatever created them, s5cmd's rm command should delete them when I use the command to empty the bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant