Invalid Bucket name when creating s3 bucket with AWS SDK

0 votes

I tried to create a S3 bucket(thisIsTestBucket190) via AWS SDK (Node) and came across Invalid bucket name exception.

{ InvalidBucketName: The specified bucket is not valid.
    at Request.extractError (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/services/s3.js:577:35)
    at Request.callListeners (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
  message: 'The specified bucket is not valid.',
  code: 'InvalidBucketName',
  region: null,
  time: 2018-03-29T04:51:02.692Z,
  requestId: '5D487CF96846EFE2',
  extendedRequestId: '1TzPeOv4c7zq+H+GV5kFMFO3Y6awoS79VCuf4C7lUmy/IucNEfbINEfEIiNp/Esz7t38ckYZbrU=',
  cfId: undefined,
  statusCode: 400,
  retryable: false,
  retryDelay: 34.88207359966853 }

Would be great if I could know what is the root cause.

Aug 30, 2018 in AWS by bug_seeker
• 15,520 points
4,113 views

1 answer to this question.

0 votes

AWS provides naming standards when naming an aws bucket.

  • The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes.

  • Each label in the bucket name must start with a lowercase letter or number.

  • The bucket name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods.

  • The bucket name cannot be formatted as an IP address (198.51.100.24).

The name provided contains upper case letters, by switching to lower case letters the issue can be resolved.

https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html

answered Aug 30, 2018 by Priyaj
• 58,090 points

Related Questions In AWS

+1 vote
2 answers

Want my AWS s3 Bucket to read Name from CloudWatch Event

CloudTrail events for S3 bucket level operations ...READ MORE

answered May 28, 2018 in AWS by Cloud gunner
• 4,670 points
1,738 views
0 votes
2 answers

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14, 2019 in AWS by athenauserz
11,249 views
0 votes
1 answer
0 votes
1 answer

How to use AWS S3 REST API ListObjects(v2) with multiple parent/child bucket directories?

Here you have to use the ListObjectsV2 ...READ MORE

answered Feb 15, 2022 in AWS by anonymous
1,067 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,090 points
5,450 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,090 points
4,866 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,810 points
2,592 views
0 votes
2 answers
0 votes
1 answer

Create AWS s3 bucket with null region

It is almost similar and It occurs ...READ MORE

answered Oct 31, 2018 in AWS by Priyaj
• 58,090 points
2,526 views
+1 vote
1 answer

Create S3 bucket using Java AWS SDK

Hey @Anjali, Creating a bucket using Java AWS-SDK ...READ MORE

answered Jan 23, 2019 in AWS by Priyaj
• 58,090 points
2,191 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP