Palash Shah
Palash Shah

Reputation: 51

Bucket names must start and end with a number or letter

I'm trying to upload a .sav file to firebase storage. But everytime I try uploaded I get this error: ValueError: Bucket names must start and end with a number or letter. None of the tutorials / questions that I've found online work to solve this.

The way I'm doing this is:


os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'credentials.json'
storer = storage.Client()
bucket = storer.get_bucket('gs://project_name.appspot.com/') #I found this on the top of my storage account.

Any ideas?

Upvotes: 2

Views: 1128

Answers (2)

Sumit Mukharjee
Sumit Mukharjee

Reputation: 337

the gs in storage bucket should not be there it should be like this -

bucket = storer.get_bucket('project_name.appspot.com/') #I found this on the top of my storage account.

Upvotes: 0

Doug Stevenson
Doug Stevenson

Reputation: 317808

get_bucket takes the name of the bucket without "gs://" and without the trailing slash (which is not a number or letter, as the error message is reminding you).

bucket = storer.get_bucket('project_name.appspot.com')

Upvotes: 5

Related Questions