Ad

Firebase Functions - You Have Exceeded Your Deployment Quota

- 1 answer

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.

Ad

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:

  1. API calls (READ) - 1 call per deployment, no matter how many functions
  2. API calls (WRITE) - 1 call per function
  3. 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.

Quotas Admin

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

Ad
source: stackoverflow.com
Ad