2

I've put data up in an S3 Bucket. Somehow the folder immediately inside the bucket has an empty folder name. No idea how this happened, but for some reason S3 allows it.

Now I can't get at any of the files inside of this folder using standard S3 browsers because of course none of them allows an empty folder name.

Has anyone dealt with this problem before? Any ideas on what I might be able to do?

1
  • Having similar issue, did put-object in S3 with a valid name and the folder name is blank for some reason...
    – Lansana
    May 25, 2018 at 14:01

4 Answers 4

2

This question is a bit old, but for those looking for an easier method.

You can delete your aws s3 folder with no name by deleting the contents within it.

The blank (no name) folder will be removed automatically.

as also mentioned, the likely cause of these existing is a double-slash. In my case I was inserting a variable between two slashes and that variable was getting returned empty, thus causing my problem.

2
  • 1
    Thanks for the downvotes on a completely accurate answer while providing no response as to an argument on why the answer isn't valid. Really helping the community there folks. Oct 1, 2019 at 5:30
  • 1
    I agree. And thank you. This worked.
    – Birey
    Nov 26, 2019 at 19:26
0

You likely have a double-slash in your final s3 prefix during upload.. for example.. the following would end up creating a blank parent object that "blah" and "foo.txt" would reside in.

aws s3 cp foo.txt s3://mybucket//blah/
0

I am not sure about why this empty folder created, sometimes I feel that it is a temp folder created by S3 and sometimes I feel that it is something wrong because of any third party connected to S3.
I deal with this folder or delete it through the Amazon console https://console.aws.amazon.com/s3/home this is the only way I could delete this folder.

0

You created the directory using // after the bucket name, so to list the files:

aws s3 ls s3://mybucket//

Copy the files elsewhere:

aws s3 sync s3://mybucket// s3://mybucket/newfolder/

Remove the // folder:

aws s3 rm --recursive s3://mybucket//

Not the answer you're looking for? Browse other questions tagged or ask your own question.