Cloud Build: build timed out (default 10 minutes) — step or total build timeout exceeded

The build ran longer than its timeout, so Cloud Build cancelled it.

Exact message you may see Build timed outERROR: build step N failed: context deadline exceededTIMEOUT Cloud BuildCloud Build STATUS: TIMEOUTbuild did not complete within timeout
Seen on: Google Cloud

Meaning

Raise timeout at the build level (and per step), cache dependencies (Kaniko cache, --cache-from), use a bigger machine type (E2_HIGHCPU_8), parallelise steps with waitFor, and avoid downloading large artifacts repeatedly.

Common causes

  • Default 600 s timeout
  • Slow dependency install/Docker build
  • Small machine type
  • No layer caching
  • Hanging step (waiting for input)

⚡ Quick fix

  1. Set timeout: 1800s
  2. Enable caching and use E2_HIGHCPU_8
  3. Fix hanging steps

Detailed fix by platform

YAML

  1. bash
    timeout: 1800s
    options:
      machineType: E2_HIGHCPU_8

How to diagnose

  1. Timeout — Default?
  2. Cache — Used?
  3. Machine — Large enough?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

1222 — SQL Server Msg 1222: Lock request time out period exceeded (SQL)1222AADSTS70021 — AADSTS70021: No matching federated identity record found for presented assertion (GitHub Actions / workload identity) (Azure)AADSTS70021another operation is in progress — Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress (Kubernetes)another operation is …Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied — Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r" (Google Cloud / Firebase)Artifact Registry: Pe…Cloud Build: step exited with non-zero status — Cloud Build: ERROR: build step 2 "gcr.io/cloud-builders/npm" failed: step exited with non-zero status: 1 (Google Cloud / Firebase)Cloud Build: step exi…Cloud Functions: Function execution took 60000 ms, finished with status: timeout — Cloud Functions: Function execution took 60002 ms, finished with status: 'timeout' (Google Cloud / Firebase)Cloud Functions: Func…Cloud Run 504: The request has been terminated because it has reached the maximum request timeout — Cloud Run: 504 Gateway Timeout — The request has been terminated because it has reached the maximum request timeout (Google Cloud / Firebase)Cloud Run 504: The re…DNS lookups take 5 seconds (timeout then retry) — Networking: Every connection pauses about 5 seconds — resolv.conf nameserver timeout, then fallback to the next DNS server (Networking)DNS lookups take 5 se…timeout

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.