Search code examples
firebasegoogle-cloud-firestoregitlab-ci

You may not have more than 32 total max instances in your project


When deploying firebase functions (google cloud functions gen 1) I am getting an error "You may not have more than 32 total max instances in your project".

I have no idea where I can find how many instances are using right now or why this error is displayed right now.


Solution

  • So it seems like Firebase servers in europe-west3 are having problems. I have found some workarounds to fix this:

    OPTION 1:

    I found something about it. It seems like you can decrease the value of max_instances in app.yaml.

    As one answer of this posts says:

    a fix required from the GCP team here. As a work around you can drop the maxInstances low enough for critical functions but you will need to delete before deploying to get the total count low enough.

    be careful if you do this workaround. You won't be able to deploy back to >32 total instances until someone at Google resolves this.

    You can check the official Google documentation for this error here.

    If this doesn't work, you may have to upgrade to a premium plan.

    OPTION 2:

    This one is the preferred so far. Unless you need to deploy to europe-west3 for some reason, change the deployment region of your functions.

    // So instead of this:
    exports.functionName = functions.region('europe-west3').https.onCall(async (data, context) => {
    
    // Do for example this: (europe-west1 is Belgium)
    exports.functionName = functions.region('europe-west1').https.onCall(async (data, context) => {