ranni rabadi
ranni rabadi

Reputation: 324

gcloud build. <service account> does not have storage.objects.get access to the Google Cloud Storage object

When I run this in cmd line:

gcloud builds submit --tag "gcr.io/<project id>/<cloudrun app name>"

I get this error:

ERROR: (gcloud.builds.submit) HTTPError 403: <?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message><Details>[service accoun name]@[project-id].iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.</Details></Error>

Here are the roles I've assigned to the Service account (yes, its overkill, just trying to get it to work):

enter image description here

I've tried these solutions, but they haven't worked:

What am I doing wrong?

Upvotes: 1

Views: 5000

Answers (3)

Klemens Zleptnig
Klemens Zleptnig

Reputation: 1824

Have you tried creating a new service with a prebuilt demo container from the web console like described here?

We got the same error ("... does not have storage.objects.get access ...") initially, but it worked once we created a first demo service using the Google Cloud Console.

Upvotes: 0

bourliam
bourliam

Reputation: 41

Hello I had the same issue. Solved it by adding the role "Viewer" to my service account as explained here : https://github.com/google-github-actions/setup-gcloud/issues/105

Upvotes: 4

Saigeetha Sundar
Saigeetha Sundar

Reputation: 144

Could you please confirm that you are using the default service account to trigger your build? If you are using a different service account to trigger the build, use the similar role which your default service account has as well.

Make sure you have the following roles for the service account:

  1. Cloud Build Service account
  2. Service Account User
  3. Cloud Run Admin

You can change the permissions from the Cloud Build Settings page.

Then try running your builds again.

Upvotes: 1

Related Questions