Reputation: 1851
I have a service account that has Storage Admin role. When I try to use client.lookup_bucket('xyz')
I get the following access error:
google.api_core.exceptions.Forbidden: 403 GET https://storage.googleapis.com/storage/v1/b/xyz?projection=noAcl: <svc_account> does not have storage.buckets.get access to the Google Cloud Storage bucket.
xyz
is a bucket that does not exist. I am able to access an existing bucket. But according to documentation - lookup_bucket will get a bucket by name, returning None if not found.
Can anyone tell me why I get the Forbidden error even though I have Storage Admin role (I even tried Owner role for the entire project and I still get the same error)
Upvotes: 1
Views: 4569
Reputation: 1253
As you can see here "Every bucket name must be unique". That means that even though you do not have a bucket called "xyz", someone else has it. You can check if this is true by trying to create a bucket with that name, you will receive a message as the below image shows. That is the reason why you get a 403 error. The bucket belongs to someone else and you do not have access to it.
Upvotes: 4