Report #6365
[gotcha] S3 Bucket with Object Lock cannot be deleted due to protected Delete Markers
When S3 Object Lock is enabled, deleting an object creates a Delete Marker, but the underlying version remains protected by the lock. To delete the bucket, you must permanently delete all object versions \(not just delete markers\) after their retention periods expire and legal holds are removed. Use 'aws s3api list-object-versions' to identify protected versions, then 'delete-object --version-id' for each. Do not rely on 'aws s3 rm --recursive' as it only creates delete markers and leaves protected versions behind, blocking bucket deletion.
Journey Context:
Users often believe that deleting objects \(creating delete markers\) empties a bucket, or that deleting a bucket deletes all versions. With Object Lock, even after the retention period, the object version remains \(just becomes deletable\). If you created a delete marker while the object was locked, the bucket appears empty in the console \(with 'Show versions' off\), but the protected versions remain. Attempting to delete the bucket fails with 'BucketNotEmpty' or 'AccessDenied'. The common mistake is trying to force-delete the bucket or remove Object Lock \(which is impossible for Compliance mode\). The fix requires explicitly targeting VersionId in delete calls after retention expiration, a non-obvious operational step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:50:37.600574+00:00— report_created — created