Skip to content
Latchkey

Cloud Run "Quota exceeded" on deploy in CI

The deploy hit a Google Cloud quota limit (RESOURCE_EXHAUSTED): a regional CPU/instance ceiling, or a per-minute API write rate. The request is rejected until the quota is raised or usage drops.

What this error means

gcloud fails with "Quota exceeded" or "RESOURCE_EXHAUSTED" naming a metric and region, for example a Cloud Run CPU allocation or a write-requests-per-minute limit.

gcloud
ERROR: (gcloud.run.deploy) RESOURCE_EXHAUSTED: Quota exceeded for quota metric
'CPU allocation, total' and limit 'CPU allocation per region' of service
'run.googleapis.com' for consumer 'project_number:123456789'.

Common causes

The region is at its CPU or instance ceiling

Total allocated CPU or max instances across services exceeds the regional quota, so a new revision cannot be admitted.

Too many API writes in a short window

Rapid repeated deploys (matrix jobs, retries) can trip a per-minute write-requests quota on the Cloud Run Admin API.

How to fix it

Request a quota increase

  1. Open IAM and Admin then Quotas, filter by the metric named in the error.
  2. Raise the limit for the affected region, or move to a less saturated region.
  3. Retry the deploy once the increase is approved.
Terminal
gcloud run deploy api --image "$IMG" --region us-east1

Cap max instances and serialize deploys

Lower --max-instances and avoid concurrent deploys from matrix jobs so per-minute write quotas are not tripped.

Terminal
gcloud run deploy api --image "$IMG" --region us-central1 --max-instances 5

How to prevent it

  • Track regional CPU/instance usage against quota before scaling up.
  • Avoid concurrent or rapidly retried deploys that spike write quotas.
  • Spread workloads across regions when one is near its ceiling.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →