Introduction Cloud Build fails with QuotaExceeded when the number of concurrent builds exceeds the project quota. This blocks CI/CD pipelines and delays deployments.
Symptoms - Build status: "QuotaExceeded" or "Failed to allocate build resource" - Error: "The project does not have enough quota remaining to create this build" - Builds queued but never start - Pipeline stuck at Cloud Build step
Common Causes - Concurrent build limit reached (default varies by project) - Too many triggered builds from multiple PRs - Build timeout too long, holding quota for extended periods - Quota not requested for the region
Step-by-Step Fix 1. **Check current quota limits**: ```bash gcloud services quotas list --service=cloudbuild.googleapis.com ```
- 1.Request quota increase:
- 2.```bash
- 3.gcloud services quotas create --service=cloudbuild.googleapis.com --metric=cloudbuild.googleapis.com/concurrent_builds --value=50 --region=us-central1
- 4.
` - 5.Or via Cloud Console: IAM & Admin > Quotas > Cloud Build API.
- 6.Check running builds:
- 7.```bash
- 8.gcloud builds list --filter="status=WORKING" --limit=20
- 9.
` - 10.Cancel stuck builds to free quota:
- 11.```bash
- 12.gcloud builds list --filter="status=WORKING" --format="value(id)" | xargs -I {} gcloud builds cancel {}
- 13.
`