iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🚨

How to resolve the 'quotas were exceeded' error during GAE deployment

に公開

While deploying to the Google App Engine (GAE) flexible environment, I encountered the following error:

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The following quotas were exceeded: BACKEND_SERVICES (quota: 9, used: 9 + needed: 1).

The cause is that the GAE flexible environment has a strict upper limit on the number of versions that can be started simultaneously, and this limit was exceeded.

I had configured it so that old instances not receiving traffic would be automatically stopped periodically, but it seems that deploying multiple times in a short period caused me to hit the limit.

Solution: Stop "Serving" versions that are not receiving traffic

As a temporary workaround, stop the "Serving" versions that are not receiving traffic.


Check the box and click [Stop]

By doing this, the used count against the limit (quota) will decrease by one, allowing you to deploy.

Fundamental Solution: Request a Quota Change

You can request to change this limit from the GCP Console.

First, access IAM [Quotas].

↑ From the list of displayed quotas, click [All Quotas] for the Compute Engine API.


↑ Check the box for the Global row and click [Edit Quotas].

↑ A form will be displayed where you can enter the new limit and the reason for the change. You can write something like "I want to deploy multiple versions to safely transition to the production environment" or "I want to run multiple versions for A/B testing."

After clicking [Done], proceed to [Next], enter your phone number, and the request will be complete.
Note: In reality, you likely won't receive a phone call.

Receive the email and click the URL to verify

When the request is approved, a confirmation email will arrive (in this case, it arrived about 1 minute later). Clicking the verification URL in the email body completes the quota increase.

The limit has been increased

This should prevent deployments from failing even when performed consecutively.

Be Careful of Charges for Multiple Serving Versions

In the GAE flexible environment, the minimum number of instances is 1. Charges will be incurred even if no traffic is flowing, as long as there are serving instances. Make sure to periodically stop old instances.

Discussion