Artyom Kulimov
Artyom Kulimov

Reputation: 27

gcloud build requires "serviceusage.services.use", but i already have owner role

I am trying to submit a build using this command in the gcloud CLI:

gcloud builds submit --config cloudbuild.yaml .

but it returns this error:

(gcloud.builds.submit) The user is forbidden from accessing the bucket [fastapi-api_cloudbuild]. Please check your organization's policy or if the user has the "serviceusage.services.use" permission

I checked in the IAM admin panel and it says that my account has the owner role and that i have most permissions, and i authenticated in the gcloud cli, but i still get said error, i havent tried much since i have no idea what i could try since i already have the highest role. thank you.

Upvotes: 1

Views: 5216

Answers (3)

KirilChe
KirilChe

Reputation: 1

While disabling and re-enabling the API may be good solution in some cases, it did not help me. What helped me is to check Cloud Storage Bucket permissions. When I changed Bucket permissions from ACL (Fine Grained) to Uniform - Github Actions stopped issuing the error mentioned. That might be the case that when you enable Cloud Build API the bucket you get has this tricky legacy ACL permissions model that adds a layer of complexity on top of regular IAM model.

best thing to do is just disable ACL on that bucket because it does not make sense IMO. And it is also not a best practice.

Upvotes: 0

Benjamin Berriot
Benjamin Berriot

Reputation: 16

I had a similar issues (caused by the change of the billing account), and I fixed it by disabling Google Cloud Build API and re-enabling.

I used this commands:

gcloud services disable cloudbuild.googleapis.com --project "my_project"

gcloud services enable cloudbuild.googleapis.com --project "my_project"

Upvotes: 0

Joacim Norbeck
Joacim Norbeck

Reputation: 201

Have you set your project in the cli with gcloud config set project <project>?

Otherwise the answer from this thread might help (billing).

or this one with Storage Admin

Upvotes: 1

Related Questions