ERROR: Error talking to S3: Server.InvalidBucketName(400): The specified bucket is not valid.

ERROR: Error talking to S3: Server.InvalidBucketName(400): The specified bucket is not valid.

While running the following command

ec2-upload-bundle --bucket http://bucket.1.s3.amazonaws.com --access-key 1234 --secret-key 5678 --manifest /tmp/image.manifest.xml

I got the following result

The specified bucket is not S3 v2 safe (see S3 documentation for details):
http:
Are you sure you want to continue? [y/N]y
Creating bucket...
ERROR: Error talking to S3: Server.InvalidBucketName(400): The specified bucket is not valid.

After searching many unresolved questions on various forums I finally figured it out for my self.

It seems that when it wants the name of the bucket it is not actually looking for the entire address (URL) where the bucket can be located. As you can see above I supplied the URL (as per a right click copy url whilst hovering over my bucket in S3Fox). What the script is actually after is the bucket name only like this.

bucket.1.s3.amazonaws.com

Interestingly enough it also works if you have two trailing slashes on the front like this

//bucket.1.s3.amazonaws.com

The giveaway for me (after checking a million other things) was the fact that the characters http: get printed to the screen for no real reason while running the ec2-upload-bundle script.

I am wondering if perhaps the creators of this script could put in some validation so that full URL’s are accepted as the bucket location.

Advertisements

3 thoughts on “ERROR: Error talking to S3: Server.InvalidBucketName(400): The specified bucket is not valid.

  1. Thanks for posting this info. I spent the better part of an afternoon trying to decipher this error, but it never occurred to me to remove the prefix from the bucket name. Thanks again!

  2. I know this is an old blog post, but it’s the top search result for the error message. I received this error message through the AWS Management Console while trying to enable the new “Website” feature on my bucket. It seems that you cannot convert your bucket into a static website if the bucket name contains capital letters. Luckily my bucket was empty so I could just delete and recreate it will all lowercase characters.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s