Can’t submit gcloud builds

google-cloud-platform

I am trying to submit a build from local workstation and getting non-descriptive error:

gcloud builds submit --config cloudbuild.yaml .
Creating temporary tarball archive of 149 file(s) totalling 121.5 MiB before compression.
Uploading tarball of [.] to [gs://***/source/1598211672.63-e76a3db01aa3435885a35cc3b94f0246.tgz]
ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: Request contains an invalid argument.

The same cloudbuild.yaml run correctly when triggered by git push or github PR comment.
Also, several months ago I was able to submit builds this way.

gcloud auth list shows that an active account is the one which definitely has Project Owner role. Furthermore I am able to execute other gcloud commands like storage bucket administration, compute instances management etc.

Best Answer

this is working as intended and it's documented here:

By default, the build returns an error if there's a missing substitution variable or a missing substitution. However, you can set the ALLOW_LOOSE option to skip this check.

also when you invoke your build with a trigger:

If your build is invoked by a trigger, the ALLOW_LOOSE option is set by default. In this case, your build will not return an error if there is a missing substitution variable or a missing substitution. You cannot override the ALLOW_LOOSE option for builds invoked by triggers.

Related Topic