My App Engine Flex deployment fails with this error code.
Updating service [default] (this may take several minutes)...failed. ERROR: (gcloud.beta.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-03-02T14:50:16.393Z7.sl.2: The region asia-southeast1 does not have enough resources available to fulfill the request. Please try again later.
When I first witnessed it -
My app threw a 502 error. Out of the blue. No code change, no push nothing.
I tried uploading a new version, I get ^^ that error. Only this time the region was there Mumbai region. southeast2 I think.
I tried to upload multiple times to no avail. I changed the configs to start up a standard environment instance. Uploaded and it worked.
I changed the config back to Flex, it ALSO worked.
A few more successful deploys later, the same error. Only this time the standard deploy and back to flex deploy gamble did not work either.
I had to start a new project, in a different zone, the current one, Singapore, and it got deployed.
Couple of weeks later, during my next deployment, this error pops up again.
I have looked everywhere and cannot find what is going wrong.
I need to understand is it something in my code/config yaml or is it to do with GCP and it being out of resources for the flex environment.
(Standard environment deploys always work, I can't use them because I need session_affinity to use websockets. session_affinity is only available in Flex)