Cloud Run 504: The request has been terminated because it has reached the maximum request timeout Google Cloud / Firebase Origin: Platform & cloud Last updated 4 Nov 2026

Cloud Run: 504 Gateway Timeout — The request has been terminated because it has reached the maximum request timeout

The request ran longer than the service's request timeout (default 5 minutes, max 60), so Cloud Run closed it.

Exact message you may see The request has been terminated because it has reached the maximum request timeout504 Gateway Timeout Cloud RunCloud Run request timeoutupstream request timeout cloud runThe request has been terminated because it has reached the maximum request timeout. To change this limit
Seen on: Google Cloud

Meaning

Long work should not block an HTTP request. Raise --timeout, return quickly and process asynchronously (Cloud Tasks, Pub/Sub, Cloud Run jobs), or fix slow downstream calls. Remember load balancers and clients have their own timeouts.

Common causes

  • Slow database or API call inside the request
  • Long-running batch work in the request path
  • Timeout left at default
  • Client/LB timeout shorter than the request
  • Cold start plus heavy initialisation

⚡ Quick fix

  1. gcloud run services update SERVICE --timeout 900 for legit long requests
  2. Move heavy work to Cloud Tasks or Cloud Run jobs
  3. Add timeouts to downstream calls

Detailed fix by platform

gcloud

  1. gcloud run services update SERVICE --timeout=900 --region REGION

How to diagnose

  1. Duration — Request time vs timeout?
  2. Work — Async possible?
  3. Downstream — Slow call?

🔧 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):

API has not been used in project before or it is disabled — Google Cloud: 403 SERVICE_DISABLED — Cloud Resource Manager API has not been used in project 123456 before or it is disabled. Enable it by visiting (Google Cloud / Firebase)API has not been used…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 403: Your client does not have permission to get URL — Cloud Run: Error: Forbidden — Your client does not have permission to get URL / from this server (Google Cloud / Firebase)Cloud Run 403: Your c…Cloud Run 503: The request failed because the instance had an error — Cloud Run: 503 Service Unavailable — The request was aborted because there was no available instance (Google Cloud / Firebase)Cloud Run 503: The re…Cloud Run: Image not found / failed to pull — Cloud Run: Revision 'svc-00005' is not ready — Image 'gcr.io/proj/app:latest' not found / Permission 'artifactregistry.repositories.downloadArtifacts' denied (Google Cloud / Firebase)Cloud Run: Image not …Container memory limit exceeded — Cloud Run: Memory limit of 512 MiB exceeded with 530 MiB used. Consider increasing the memory limit (Google Cloud / Firebase)Container memory limi…Your active project does not match the quota project in your local ADC — gcloud/ADC: WARNING: Your active project does not match the quota project in your local Application Default Credentials file (Google Cloud / Firebase)Your active project d…Cloud Run…

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.