Gcloud builds submit fails on "global" violates constraint "constraints/gcp.resourceLocations"

Viewed 1222

I am working a lot with the Google Cloud Platform. Last year, we instated the resource constraint policy "constraints/gcp.resourceLocations" to Europe only. As of today, we are seeing a lot of strange errors when submitting a cloud build. Does anyone know if Google recently changed something in their Cloud Build service and make it regional?

The following command used to work:

gcloud builds submit .

However, overnight (12 november 2020), we got the following error:

ERROR: (gcloud.builds.submit) FAILED_PRECONDITION: "global" violates constraint "constraints/gcp.resourceLocations" on the resource "projects/[PROJECT_ID]/locations/global/builds/[UUID]"

  • '@type': type.googleapis.com/google.rpc.PreconditionFailure violations:
    • description: '"global" violates constraint "constraints/gcp.resourceLocations"

When running the following command:

gcloud builds submit . --region=europe-west1

The following error appears:

ERROR: (gcloud.builds.submit) User [USER] does not have permission to access projects instance [PROJECT_ID] (or it may not exist): project is not on the allowlist for Regional Cloud Build, please contact cloud-build-contact@google.com

1 Answers

That was an internal issue on the GCP side, which has been fixed shortly by the Cloud Build engineering team.

Related