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.
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 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
gcloud run services update SERVICE --timeout 900for legit long requests- Move heavy work to Cloud Tasks or Cloud Run jobs
- Add timeouts to downstream calls
Detailed fix by platform
gcloud
gcloud run services update SERVICE --timeout=900 --region REGION
How to diagnose
- Duration — Request time vs timeout?
- Work — Async possible?
- 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:
Similar errors
- 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
- Cloud Functions: Function execution took 60000 ms, finished with status: timeout Cloud Functions: Function execution took 60002 ms, finished with status: 'timeout'
- 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
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- Could not load the default credentials Google Cloud: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026