My gcloud build will timeout if left at the default timeout of 10 minutes, so I have tried to increase the timeout to 20 minutes. This is my cloudbuild.yaml.
# cloudbuild.yaml
steps:
- name: node:14.17.1
entrypoint: npm
args: ["install"]
- name: node:14.17.1
entrypoint: npm
args: ["run", "build"]
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
timeout: 1200s
It processes Step 0 and Step 1 and fails at Step 2, which is gcloud app deploy. The execution log reports the following error:
ERROR: gcloud crashed (InvalidBuildError): Field [timeout] was provided, but should not have been. You may be using an improper Cloud Build pipeline.
All the documentation I've says that this is how you increase the timeout, some say the the timeout needs to be wrapped in single quotes, but this doesn't appear to be true as if I review the Execution details, it correctly identifies that the timeout is 20 minutes. Trying with single quotes makes no difference to the outcome.
I've also tried setting a timeout at the app deploy step as well, but it produces the same error and would be ineffectual anyway as it is the entire build process that is exceeding the execution time if left at default.
timeoutfirst in case of a flawed parse? It's particularly curious that it's rejectingtimeoutentirely. Even if your YAML were incorrectly indented,timeoutshould work either for the job or the step. Perhaps file an issue on issuetracker google.com? Meantime, you should be able to apply the timeout as a flag instead:gcloud builds submit ... --timeout=1200s ...- DazWilkintimeoutargument isn't a valid flag forgcloud app. Unless I have to restructure the process to usegcloud builds- littleowlnest--timeouttogcloud builds submit(which you are using). I wonder whether thegcloudthat's crashing is the one used bygcloud app deploy ...in step #2? I assumed it was thegcloud build submit ...that you're using to create the job. One thing to bear in mind (and a possible culprit) is that, becausegcloud app deployitself using Cloud Build to build your app, the issue may arise in that child build. I'm unfamiliar with Node.JS but do you neednpm installandnpm run buildsteps? - DazWilkingcloud app deploy ...directly without Cloud Build to deploy the app. What happens then? See the documentation for deploying Node.JS apps to App Engine: cloud.google.com/appengine/docs/standard/nodejs/… - DazWilkingcloud buildsandgcloud appare different commands. I'm using automated builds with a trigger in Cloud Build. "Inline YAML" is an option in the Cloud Build GUI, so instead of using a cloudbuild.yaml file, the execution will use YAML that has been typed in.gcloud app deployis definitely using the same build process as Cloud Build. - littleowlnest