GCP

QUOTA_EXCEEDED - Quota Exceeded: Resource Limit Reached

QUOTA_EXCEEDED hits when you've maxed out your project or regional quota for a resource type—GCP's control plane enforces hard limits per project and per region. This server-side error means you've hit the ceiling for VM instances, disks, Cloud SQL instances, GKE clusters, or BigQuery query quotas. Most common in Compute Engine when you've created the maximum allowed VMs or disks, but also appears in Cloud SQL instance quotas, GKE cluster and node quotas, and BigQuery query and storage quotas. Quota exhaustion is persistent until you delete unused resources or request increases via Cloud Console—unlike RESOURCE_EXHAUSTED, this specifically indicates quota limits, not capacity stockouts.

#Common Causes

  • Resource Quota Exhaustion: You've created the maximum number of resources allowed by your quota. Quotas vary by resource type and subscription tier. This is persistent—you must free quota or request an increase.
  • API Quota/Rate Limit Exhaustion: You've exceeded the rate limit or quota for API requests. Rate limits are enforced per API and per project. This is transient—waiting and retrying with rate limiting helps.
  • Regional Quota Limit: You've hit the quota limit in a specific region. Quotas are enforced per region, so you may have capacity in other regions. This is persistent—you must free quota in that region or request an increase.
  • Service-Specific Quota Limits: Quota limits vary by service and resource type. Some quotas reset daily, others are permanent until you request an increase.

Solutions

  1. 1Step 1: Diagnose - Check quota usage to see which quota is exhausted: gcloud compute project-info describe --project PROJECT_ID --format="table(quotas.metric,quotas.limit,quotas.usage)"
  2. 2Step 2: Diagnose - Check specific quota (e.g., VM instances): gcloud compute project-info describe --project PROJECT_ID --format="get(quotas[metric=INSTANCES].limit,quotas[metric=INSTANCES].usage)"
  3. 3Step 3: Diagnose - Check if quota is regional by reviewing quota details for region-specific limits.
  4. 4Step 4: Fix - Free quota by deleting unused resources: gcloud compute instances list --filter="status:TERMINATED" --format="value(name,zone)" --project PROJECT_ID Then delete them to free quota.
  5. 5Step 5: Fix - For API rate limits, implement rate limiting and exponential backoff in your client code.
  6. 6Step 6: Fix - Request quota increase via Cloud Console: IAM & Admin > Quotas (note: requires approval, not immediate).
  7. 7Step 7: Fix - Use a different region if regional quota is exhausted: gcloud compute zones list Then create resources in a region where you haven't hit the quota.
  8. 8Step 8: Verify - Retry the operation after freeing quota or requesting an increase.

</>Code Examples

Quota Management and Cleanup
1# This script helps diagnose and fix QUOTA_EXCEEDED errors
2
3PROJECT_ID="my-project"
4
5# Step 1: Check all quota usage
6echo "Checking quota usage..."
7gcloud compute project-info describe \
8  --project $PROJECT_ID \
9  --format="table(quotas.metric,quotas.limit,quotas.usage)"
10
11# Step 2: Check specific quota (example: VM instances)
12echo "Checking VM instances quota..."
13gcloud compute project-info describe \
14  --project $PROJECT_ID \
15  --format="get(quotas[metric=INSTANCES].limit,quotas[metric=INSTANCES].usage)"
16
17# Step 3: List terminated instances that can be deleted to free quota
18echo "Checking for terminated instances..."
19TERMINATED_INSTANCES=$(gcloud compute instances list \
20  --filter="status:TERMINATED" \
21  --format="value(name,zone)" \
22  --project $PROJECT_ID)
23
24if [ ! -z "$TERMINATED_INSTANCES" ]; then
25  echo "Found terminated instances. Deleting to free quota..."
26  echo "$TERMINATED_INSTANCES" | while read name zone; do
27    echo "Deleting instance $name in zone $zone..."
28    gcloud compute instances delete $name --zone $zone --quiet --project $PROJECT_ID
29  done
30else
31  echo "No terminated instances found"
32fi
33
34# Step 4: List unattached disks (can be deleted to free quota)
35echo "Checking for unattached disks..."
36UNATTACHED_DISKS=$(gcloud compute disks list \
37  --filter="status:UNATTACHED" \
38  --format="value(name,zone)" \
39  --project $PROJECT_ID)
40
41if [ ! -z "$UNATTACHED_DISKS" ]; then
42  echo "Found unattached disks:"
43  echo "$UNATTACHED_DISKS"
44  # Uncomment to delete unattached disks:
45  # echo "$UNATTACHED_DISKS" | while read name zone; do
46  #   gcloud compute disks delete $name --zone $zone --quiet --project $PROJECT_ID
47  # done
48fi
49
50# Step 5: Request quota increase via Console
51echo "To request quota increase:"
52echo "  1. Go to Cloud Console > IAM & Admin > Quotas"
53echo "  2. Select the quota you want to increase"
54echo "  3. Click 'Edit Quotas' and request an increase"

Related Errors

Provider Information

This error code is specific to GCP services. For more information, refer to the official GCP documentation.

QUOTA_EXCEEDED - Quota Exceeded: Resource Limit Reached | GCP Error Reference | Error Code Reference