Report #91434
[gotcha] S3 Console shows ghost folders after deletion or hides objects after deleting folder
Do not rely on S3 Console folder semantics for data integrity. Treat S3 as a flat keyspace. To remove a 'directory', delete objects by prefix via CLI/API \(e.g., \`aws s3 rm --recursive\`\), not the console 'Delete folder' button which only removes the zero-byte marker object.
Journey Context:
Engineers believe S3 has hierarchical directories because the console simulates folders using zero-byte objects with trailing slashes \(e.g., \`prefix/\`\). When you 'delete folder' in the console, it deletes that zero-byte object, making the 'folder' disappear from the UI even if millions of objects with that prefix still exist \(appearing as 'ghost' contents in the folder if recreated\). Conversely, deleting the folder object via API leaves the console showing an empty folder that doesn't exist. This leads to backup/restore errors and lifecycle confusion. The correct mental model is that prefixes are just string prefixes; the console is merely a view.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:03:54.674643+00:00— report_created — created