Search code examples
google-app-engine

Error while trying to deploy to Google App Engine: max instances limit


I am trying to deploy a new version of my app on Google App Engine, but it fails with this error:

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: You may not have more than 32 total max instances in your project.

I am surprised because the configuration file mentions 1 for max instances:

runtime: nodejs18
service: staging
instance_class: B1
basic_scaling:
  max_instances: 1
  idle_timeout: 5m

The full trace:

gcloud app deploy --project=abc123 app.staging.yaml
Services to deploy:

descriptor:                  [<redacted>/gae-payload/app.staging.yaml]
source:                      [<redacted>/gae-payload]
target project:              [spfblogcollection]
target service:              [staging]
target version:              [20230517t155800]
target url:                  [https://staging-dot-<redacted>.ey.r.appspot.com]
target service account:      [<redacted>@appspot.gserviceaccount.com]


Do you want to continue (Y/n)?  Y

Beginning deployment of service [staging]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage                 ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: You may not have more than 32 total max instances in your project.

gcloud version:

Google Cloud SDK 431.0.0
alpha 2023.05.12
beta 2023.05.12
bq 2.0.92
bundled-python3-unix 3.9.16
cloud-datastore-emulator 2.3.0
core 2023.05.12
gcloud-crc32c 1.0.0
gsutil 5.23

Solution

  • The solution is to delete old unused version from App Engine through the console, because these versions seem to count toward the project-level max instances even if not used anymore. It makes sense but I was surprised.

    Otherwise, in case that may help someone, it seems that deploying with automatic scaling works:

    runtime: nodejs18
    service: staging
    instance_class: F1
    automatic_scaling:
      max_instances: 1