This HTTP 429 error occurs when you exceed Firebase's API rate limits while deploying Cloud Functions, typically when deploying many functions simultaneously or in rapid succession through CI/CD pipelines.
This error indicates that your Firebase project has exceeded the Google Cloud Functions API write quota, which limits how many deployment operations you can perform per minute. When you deploy functions, the Firebase CLI makes API calls to the cloudfunctions.googleapis.com service to create or update each function. If too many deployment requests are made in a short time period, Google Cloud returns an HTTP 429 "Too Many Requests" status code to prevent API overload. This quota exists to protect Google's infrastructure and ensure fair usage across all projects. The write quota specifically controls deployment operations (creating, updating, or deleting functions) and is separate from quotas that govern function execution or invocation. Importantly, this is a fixed quota that cannot be increased through standard quota increase requests. The error most commonly occurs in CI/CD environments where automated deployment pipelines attempt to deploy all functions at once, or when developers deploy large numbers of functions using a single `firebase deploy --only functions` command.
The API quota resets automatically after a time window (typically 1 minute). Wait 1-2 minutes before attempting another deployment:
# Wait before retrying
sleep 120
firebase deploy --only functionsThis simple pause often resolves the immediate issue and allows your next deployment to succeed.
Instead of deploying all functions at once, deploy them in groups of 10 or fewer using the --only flag:
# Deploy specific function groups
firebase deploy --only functions:userAuth,functions:dataProcessor,functions:emailSender
# Or deploy individual functions
firebase deploy --only functions:sendWelcomeEmail
firebase deploy --only functions:processPaymentThis reduces the number of API calls made in a short time period and stays within quota limits.
Create a deployment script that deploys functions sequentially with delays between batches:
// deploy-functions.js
const { execSync } = require('child_process');
const fs = require('fs');
// Get all function names from firebase.json or functions/index.ts
const functionNames = [
'userAuth',
'dataProcessor',
'emailSender',
'webhookHandler',
// ... add all your functions
];
const BATCH_SIZE = 10;
const DELAY_MS = 5000; // 5 second delay between batches
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function deployInBatches() {
for (let i = 0; i < functionNames.length; i += BATCH_SIZE) {
const batch = functionNames.slice(i, i + BATCH_SIZE);
const functionList = batch.map(name => `functions:${name}`).join(',');
console.log(`Deploying batch ${Math.floor(i / BATCH_SIZE) + 1}: ${batch.join(', ')}`);
try {
execSync(`firebase deploy --only ${functionList}`, { stdio: 'inherit' });
console.log('Batch deployed successfully');
} catch (error) {
console.error('Batch deployment failed:', error.message);
process.exit(1);
}
if (i + BATCH_SIZE < functionNames.length) {
console.log(`Waiting ${DELAY_MS / 1000} seconds before next batch...`);
await sleep(DELAY_MS);
}
}
}
deployInBatches();Run with: node deploy-functions.js
Update your CI/CD configuration to deploy functions in batches. Example for GitHub Actions:
# .github/workflows/deploy.yml
name: Deploy Firebase Functions
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Deploy batch 1
run: firebase deploy --only functions:batch1FuncA,functions:batch1FuncB
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Wait
run: sleep 10
- name: Deploy batch 2
run: firebase deploy --only functions:batch2FuncA,functions:batch2FuncB
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}For GitLab CI:
# .gitlab-ci.yml
deploy:
stage: deploy
script:
- firebase deploy --only functions:groupA
- sleep 10
- firebase deploy --only functions:groupB
- sleep 10
- firebase deploy --only functions:groupC
only:
- mainMonitor your actual quota usage to understand your limits:
1. Go to the Google Cloud Console: https://console.cloud.google.com
2. Select your Firebase project
3. Navigate to IAM & Admin > Quotas
4. Search for "Cloud Functions API"
5. Look for "Write requests per minute" quota
You can view current usage and limits here. Note that the deployment write quota typically cannot be increased, so you must work within the existing limits.
During active development, deploy only the functions you're currently working on:
# Deploy only the function you modified
firebase deploy --only functions:myNewFunction
# Or use function groups defined in firebase.json
firebase deploy --only functions:authThis reduces unnecessary deployments and conserves your quota for when you need full deployments.
Understanding Firebase Functions API Quotas: The Cloud Functions API has separate quotas for different operations. The WRITE quota (which governs deployments) is distinct from READ quotas (listing functions) and CALL quotas (invoking functions via the API). The deployment quota is intentionally conservative to prevent infrastructure overload and cannot be increased through quota requests, unlike some other Google Cloud quotas.
Function Grouping Strategy: For large projects, organize your functions into logical groups in your codebase (e.g., auth.ts, data.ts, notifications.ts) and deploy groups separately. This makes selective deployments easier and naturally batches your deployments.
Handling Deployment Failures: If a batch deployment fails partway through, Firebase Functions are designed to be idempotent. You can safely retry the same deployment command - functions that were successfully deployed won't be redeployed unnecessarily, only failed or pending functions will be processed.
First vs Second Generation Functions: This quota applies to both Cloud Functions 1st gen and 2nd gen. However, 2nd gen functions (built on Cloud Run) may have different performance characteristics. If you're experiencing frequent quota issues, consider whether your deployment strategy could be optimized regardless of function generation.
Alternative: Use Firebase Extensions: For common functionality, consider using Firebase Extensions instead of custom functions. Extensions are pre-built and don't count against your deployment quota since they're installed rather than deployed.
messaging/UNSPECIFIED_ERROR: No additional information available
How to fix "messaging/UNSPECIFIED_ERROR: No additional information available" in Firebase Cloud Messaging
App Check: reCAPTCHA Score Too Low
App Check reCAPTCHA Score Too Low
storage/invalid-url: Invalid URL format for Cloud Storage reference
How to fix invalid URL format in Firebase Cloud Storage
auth/missing-uid: User ID identifier required
How to fix "auth/missing-uid: User ID identifier required" in Firebase
auth/invalid-argument: Invalid parameter passed to method
How to fix "auth/invalid-argument: Invalid parameter passed to method" in Firebase