Firebase Functions - You Have Exceeded Your Deployment Quota
I have a Firebase Functions project with 70+ functions. It runs on Node 8.
After 5-7 full deployments I am getting an error:
You have exceeded your deployment quota, please deploy your functions in batches by using the --only flag, and wait a few minutes before deploying again. Go to https://firebase.google.com/docs/cli/#deploy_specific_functions to learn more
It is not clear what is the reason for that? Which limit I have reached? When quota will renew?
Deployment is not working after a few minutes.
Answer
I have asked for help on Firebase Community slack and now I understand what has happened. Thanks, @katowulf.
Quotas are described here: https://firebase.google.com/docs/functions/quotas#quota_limits_for_firebase_cli_deployment
We have 3 quotas related to deployment which are:
- API calls (READ) - 1 call per deployment, no matter how many functions
- API calls (WRITE) - 1 call per function
- Max build time - A few minutes per function depending on size
To see which one you have hit you can go to quotas admin: https://console.cloud.google.com/projectselector2/projectselector/iam-admin/quotas?service=cloudfunctions.googleapis.com&usage=ALL&supportedpurview=project
In my case, I have hit quota 3. Max build time
which is limited to 12000 seconds per day (by default). After some experiments, I have noticed that one function deploy adds around ~70 sec to build time (might be a different number in your case!). So 12000/70 gives around 170 functions deploys per day.
On Quotas admin page (second link) you can ask to increase any quota with Edit Quota
option. 36000 sec build time is available without any additional approvals which in my case increased individual functions deploys number to 500+ per day.
A quota was reset to 0 around 0:00 UTC-07:00 and my functions are deployed to us-central1. So day seems to have a fixed time slot (it is NOT last 24h moving window).
For bigger projects, you should not deploy the whole project all at once, but just individual functions like described in a link https://firebase.google.com/docs/cli/#deploy_specific_functions
Related Questions
- → How can I query Firebase for an equalTo boolean parameter?
- → How can I access nested data in Firebase with React?
- → Firebase simple blog (confused with security rules)
- → Removing item in Firebase with React, re-render returns item undefined
- → AngularJS Unknown Provider Error (Firebase & AngularFire)
- → How do you pass top level component state down to Routes using react-router?
- → "this" is null in firebase query function in reactjs
- → Angular Module Failed to Load
- → Multiple dex files define Lcom/google/android/gms/internal/zzrx;
- → Joining Firebase tables in React
- → How can I make add firepad to my reactjs project?
- → How to use Cloud Functions for Firebase to prerender pages for SEO?
- → React.js component has null state?