Score:0

Cannot build any functions with cloud function

th flag

Somehow I keep getting build failures in our new cloud environment. I tried with nodejs and python default HelloWorld cloud functions, both failed with no specific error messages. Below is one of the ERRORs:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: {"error":{"buildpackId":"","buildpackVersion":"","errorType":"OK","canonicalCode":"OK","errorId":"","errorMessage":""},"stats":[{"buildpackId":"google.utils.archive-source","buildpackVersion":"0.0.1","totalDurationMs":45,"userDurationMs":41},{"buildpackId":"google.python.functions-framework","buildpackVersion":"0.9.5","totalDurationMs":78,"userDurationMs":78},{"buildpackId":"google.python.pip","buildpackVersion":"0.9.2","totalDurationMs":5190,"userDurationMs":5186},{"buildpackId":"google.utils.label","buildpackVersion":"0.0.1","totalDurationMs":0,"userDurationMs":0}],"warnings":null}
Score:0
br flag

I did have the same problem. Even the examples did not work (tried python and nodejs, as well as the Terraform module examples).

As I drilled down, I found some build logs in Cloud Build History:

"build": eu.gcr.io/<project-id>/gcf/<region>/<some-uuid>:hello_gcs_version-2 - GET https://eu.gcr.io/v2/token?scope=repository%3A<project-id>%2Fgcf%2F<region>%2F<same-uuid>%3Apush%2Cpull&scope=repository%3Afn-img%2Fbuildpacks%2Fpython39%2Frun%3Apull&service=eu.gcr.io: DENIED: Token exchange failed for project '<project-id>'. Org Policy Violated: 'eu' violates constraint 'constraints/gcp.resourceLocations'

For me what it took was to override the Organization Policy (https://console.cloud.google.com/iam-admin/orgpolicies/gcp-resourceLocations/edit-v2) and make it "Google Managed"

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.