'App Engine Flexible deployment fails to become healthy in the allotted time

My flask app deployment via App Engine Flex is timing out and after setting debug=True. I see the following line repeating over and over until it fails. I am not sure however what this is and cannot find anything useful in logs explorer.

Updating service [default] (this may take several minutes)...working DEBUG: Operation [apps/enhanced-bonito-349015/operations/81b83124-17b1-4d90-abdc-54b3fa28df67] not complete. Waiting to retry.

Could anyone share advice on where to look to resolve this issue?

Here is my app.yaml (I thought this was due to a memory issue..):

runtime: python
env:flex
entrypoint: gunicorn - b :$PORT main:app

runtime_config:
   python_version:3

resources:
   cpu:4
   memory_gb: 12
   disk_size_gb: 1000

readiness_check:
  path: "/readines_check"
  check_interval_sec: 5
  timeout_sec: 4
  failure_threshold: 2
  success_threshold: 2
  app_start_timeout_sec: 300

Error logs:

ERROR: (gcloud.app.deploy) Error Response: [4] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-05-10T23:21:10.941Z47607.vt.0: Your deployment has failed to become healthy in the allotted time and therefore was rolled back. If you believe this was an error, try adjusting the 'app_start_timeout_sec' setting in the 'readiness_check' section.



Solution 1:[1]

There could be possible ways to resolve such deployment errors.

  1. Increase the value of app_start_timeout_sec to the maximum value which is 1800
  2. Make sure that all the Google Cloud services that Endpoints and ESP require are enabled on your project.
  3. Assuming that splitHealthChecks feature is enabled, make sure to follow all the steps needed when migrating from the legacy version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Catherine O