The Google Cloud Container Builder API documentation says that you are able to set the timeout through the API.

Our build are triggered by webhooks, meaning that the API is irellevant for us. Is there a way to set the build timeout on automatically triggered builds?


For build triggers, you can specify the same parameters as a build resource in your cloudbuild.yaml, which includes the timeout parameter. For example:

- name: 'ubuntu'
  args: ['./binary', 'rawdata.tgz']

timeout: 1200s
  • I'm getting ERROR: gcloud crashed (InvalidBuildError): Field [timeout] was provided, but should not have been. You may be using an improper Cloud Build pipeline. Hints appreciated!
    – icarito
    Mar 23 '19 at 7:11
  • If anyone encounters what I did, I finally could move on removing this from the cloudbuild.yaml and instead configuring it with the gcloud command:gcloud config set app/cloud_build_timeout 1200
    – icarito
    Mar 24 '19 at 2:10

There are two places to put the time out in the yaml file.....

  1. In the build step which is set as a max of 10 minutes by the system
  2. In the file which controls the overall build time of the whole file.

The line indent controls this.

No indent then Timeout: 1200s is possible

Build Step indent then max Timeout: 10m0s

  • I get Your build failed to run: failed unmarshalling build config cloudbuild.yaml: unknown field "timout" in google.devtools.cloudbuild.v1.Build unless I have the timeout field nested in one of the build steps.
    – threed
    May 20 '20 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.