Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PERL Net::Amazon::S3 BucketAlreadyExists: The requested bucket name is not available

Tags:

my $bucketname = "test"; my $bucket = $s3->add_bucket( { bucket => "$bucketname" } )     or die $s3->err . ": " . $s3->errstr; 

Running this code gives me this error.

BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.

The bucket does not exist. I am not sure what's wrong.

Thanks

like image 466
Joey BagODonuts Avatar asked Oct 20 '11 21:10

Joey BagODonuts


People also ask

How do you check if S3 bucket already exists?

To check whether a bucket already exists before attempting to create one with the same name, call the doesBucketExist method. It will return true if the bucket exists, and false otherwise. if (s3. doesBucketExistV2(bucket_name)) { System.

How do I enable ACL for S3 bucket?

To set ACL permissions for a bucketSign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to set permissions for. Choose Permissions. Under Access control list, choose Edit.


1 Answers

S3 buckets are a global namespace, and so it's very possible that someone else took the same bucket before you could get it. It's also possible that due to internal replication delays or other such issues, a previously-deleted bucket is not yet available for re-use.

In this particular case, "test" is a VERY generic bucket name. I'm sure everyone and their dog is trying to use it - and when I try LISTing it, I get a AllAccessDisabled error. It looks like the S3 team has disabled the "test" bucket specifically because too many people try to use it as their bucket name.

So, in short, you need to pick a unique bucket name - one that NOBODY else is using.

like image 118
bdonlan Avatar answered Sep 21 '22 04:09

bdonlan