Can't delete directory from Amazon S3

I had the same problem in the AWS web interface after AWS Command Line (CLI)-deleting a "recursive" folder in a bucket. Some objects randomly reappeared (not files, but in fact "folders") in the web interface. Even though i tried to delete these folders in the web interface, they were still there (The interface said the operation was successful...)

Solution that worked for me in the AWS web interface: Right clicked the folder -> CUT, and PASTE into another folder. Worked great, and then deleted the new folder. Gone!


Tried the same as Kristoffer's answer, but CUT/PASTE to another folder made the new folder to not be deletable.

Further hacking: create a new temporary bucket. CUT/PASTE the folder to this bucket and delete the bucket.


S3 does not actually use folders. Instead the path separators in object paths are treated like folders. If you want to remove a folder, all the contents of the folder will have to get deleted.

If there is any delay in deleting all of the contents, the folder may continue to exist.