- Newest
- Most votes
- Most comments
Hi,
Your bucket probably contains 1 namespace (or more) and 1 table (or more)
You have to start deleting them via CLI (tables then namespaces) to be finally able to delete the bucket.
To give you an idea, a sample of my S3Tables Python library to do that: (I'll publish it after some polishin)
def cleanup(bucket: S3TableBucketT) -> bool:
if bucket is not None and bucket.exists():
namespaces = S3Namespace.list(bucket)
if namespaces is not None and len(namespaces) > 0:
for namespace in namespaces:
tables = S3Table.list(namespace)
if tables is not None and len(tables) > 0:
for table in tables:
print("\ntearDown() - deleting existing table:", table.name, " - namespace:", namespace.name)
table.delete()
print("\ncleanup() - deleting existing namespace:", namespace.name)
namespace.delete()
print("\ncleanup() - deleting existing bucket:", bucket.name)
assert bucket.delete()
assert not bucket.exists()
return True
Best
It appears you're encountering an issue while trying to delete an S3 Table bucket. The error message suggests that the bucket is not empty, even though you've deleted the S3 tables within it. This situation can occur due to a few reasons:
-
Versioning: If versioning is enabled on the bucket, there might be previous versions of objects or delete markers still present in the bucket.
-
Incomplete multipart uploads: There could be incomplete multipart uploads in the bucket.
-
Replication: If replication is configured, there might be replication-related markers in the bucket.
To resolve this issue, you can try the following steps:
-
Double-check that all S3 tables have been deleted using the AWS CLI or console.
-
Use the S3 console to manually inspect the bucket contents and delete any remaining objects or versions.
-
If using the AWS CLI, you can use the
s3 rbcommand with the--forceoption to remove the bucket and its contents:aws s3 rb s3://my-table-bucket --forceReplace "my-table-bucket" with your actual bucket name.
-
If the issue persists, you may need to use the
DeleteTableBucketAPI operation, which is specifically designed for S3 Table buckets. However, make sure you have the necessary permissions (s3:DeleteTableBucket) to perform this operation.
If these steps don't resolve the issue, you may need to contact AWS support for further assistance, as there might be underlying issues specific to S3 Table buckets that are not visible through standard S3 operations.
Sources
DeleteTableBucket - Amazon Simple Storage Service
Deleting the Amazon S3 buckets - Verifiable Controls Evidence Store
Deleting a bucket - Amazon Simple Storage Service
answered 2 years ago
Relevant content
asked 2 years ago
asked a year ago
