I am getting an error when I try to deploy to app engine through Google cloud. I was able to run this without any issues before and now I am not able to understand what is the reason. Can anyone please help us figure out ?
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: You may not have more than 32 total max instances in your project.
Build step ‘Execute shell’ marked build as failure
Finished: FAILURE
There are no instances currently running and I also tried adding below config to app.yaml , still same issue.
automatic_scaling:
max_instances:1
Hi @harisankar-ayla ,
Welcome to Google Cloud Community!
Google has enforced a max instance limit per project of 32 for projects for certain projects in order to prevent abuse. When customers exceed this limit, they will see the error “You may not have more than %d total max instances in your project.” during deployment. This limit would apply to manually scaled instances as well as max_instance limit for automatic/basic scaling.
Try to check your instance states again, see if you have any auto-scaled service as its instance is always running. You can change the state of your instances by managing your versions. You can use [gcloud app versions start](https://cloud.google.com/sdk/gcloud/reference/app/versions/start) and [gcloud app versions stop](https://cloud.google.com/sdk/gcloud/reference/app/versions/stop) commands. For more information, visit here.
You may opt to contact Google Support so they can check your project and see if there are any problems.
Just to add, setting a max instance count to a value lower than 3 can affect the availability of a service. According to this documentation:
Apps deployed with max_instances set to 3 or less might experience unexpected errors or downtime. To resolve the issue, specify at least 4 maximum instances in app.yaml and redeploy.
I’d recommend to set at least 3 max instances for your services.
Hope this helps.
Just go to G Cloud Dashboard, choose App Engine. On a left menu choose Versions and delete old unused versions. You are welcome