gsutil make bucket command [gsutil mb] is not working

11,446

Solution 1

One reason this error can occur (confirmed in chat with the question author) is that you have an invalid default_project_id configured in your .boto file. Ensure that ID matches your project ID in the Google Developers Console

If you can make a bucket successfully using the Google Developers Console, but not using "gsutil mb", this is a good thing to check.

Solution 2

I got the same error. I was because I used the wrong location. The location parameter expects a region without specifying witch zone.

Eg.

sutil mb -p ${TF_ADMIN} -l europe-west1-b  gs://${TF_ADMIN}

Should have been

sutil mb -p ${TF_ADMIN} -l europe-west1  gs://${TF_ADMIN}

Solution 3

I was receiving the same error for the same command while using gsutil as well as the web console. Interestingly enough, changing my bucket name from "google-gatk-test" to "gatk" allowed the request to go through. The original name does not appear to violate bucket naming conventions.

Playing with the bucket name is worth trying if anyone else is running into this issue.

Share:
11,446
K M Rakibul Islam
Author by

K M Rakibul Islam

I am a Software Engineer from Toronto, Canada. I like to learn new things and try new technologies. I am an open source enthusiast and I want to make this world a better place by making software for good purposes. I am passionate about teaching and helping people. I have a Bachelors in Computer Science and Engineering and a Masters in Computer Engineering from the University of Toronto. I like to help people at Stackoverflow as I enjoy sharing knowledge with others and I learn a lot along the way. #SOreadytohelp The views and opinions expressed here are my own only and in no way represent the views, positions or opinions - expressed or implied - of my employer (present and past). #Contact The quickest way to reach me is to email me at: [email protected]

Updated on June 09, 2022

Comments

  • K M Rakibul Islam
    K M Rakibul Islam about 2 years

    I am trying to create a bucket using gsutil mb command:

    gsutil mb -c DRA -l US-CENTRAL1 gs://some-bucket-to-my-gs
    

    But I am getting this error message:

    Creating gs://some-bucket-to-my-gs/...
    BadRequestException: 400 Invalid argument.
    

    I am following the documentation from here

    What is the reason for this type of error?

  • beepscore
    beepscore about 5 years
    For me terminal showed BadRequestException: 400 Use of this bucket name is restricted. My attempted bucket name contained "google" and cloud.google.com/storage/docs/naming explicitly states: Bucket names cannot begin with the "goog" prefix. Bucket names cannot contain "google" or close misspellings, such as "g00gle".