Skip to content

Issue deleting an S3Table bucket

0

I've been messing around with the new S3Table buckets. Trying now to tidy up what I've created. I deleted the S3tables that were in there and now when I try and delete the bucket it's complaining it's not empty - which it is. Here is the CLI output. Obscured my account number with Y's

(base) C:\Users\thoma>aws s3tables list-tables --region us-east-2 --table-bucket-arn arn:aws:s3tables:us-east-2:YYYYYYYYYYYY:bucket/my-table-bucket { "tables": [] } (base) C:\Users\thoma>aws s3tables delete-table-bucket --region us-east-2 --table-bucket-arn arn:aws:s3tables:us-east-2:YYYYYYYYYYYY:bucket/my-table-bucket

An error occurred (BadRequestException) when calling the DeleteTableBucket operation: The bucket that you tried to delete is not empty.

asked 2 years ago1.1K views

2 Answers
1

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

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

-1

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:

  1. Versioning: If versioning is enabled on the bucket, there might be previous versions of objects or delete markers still present in the bucket.

  2. Incomplete multipart uploads: There could be incomplete multipart uploads in the bucket.

  3. Replication: If replication is configured, there might be replication-related markers in the bucket.

To resolve this issue, you can try the following steps:

  1. Double-check that all S3 tables have been deleted using the AWS CLI or console.

  2. Use the S3 console to manually inspect the bucket contents and delete any remaining objects or versions.

  3. If using the AWS CLI, you can use the s3 rb command with the --force option to remove the bucket and its contents:

    aws s3 rb s3://my-table-bucket --force
    

    Replace "my-table-bucket" with your actual bucket name.

  4. If the issue persists, you may need to use the DeleteTableBucket API 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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.