App Engine Updating service default Error

google-app-enginegoogle-cloud-platform

I'm trying to deploy a simple flask app to Google App Engine. When I run the command gcloud app deploy, it finish all the task, but then it get stack on the "update service".
At first I got this error:

ERROR: (gcloud.app.deploy) Error Response: [4] 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.

Then I increase the timeout time, but I still got this error:

ERROR: (gcloud.app.deploy) Operation [apps/artise-server/operations/a3a9a2ac-f33b-4c94-93f1-88917372703e] timed out. This operation may still be underway.

This is my .yaml config:

runtime: python
runtime_config:
    python_version: 3.6
env: flex
entrypoint: gunicorn -b :$PORT main:app
liveness_check:
  check_interval_sec: 60
  timeout_sec: 4
  failure_threshold: 10
  success_threshold: 1
  initial_delay_sec: 3600

readiness_check:
  check_interval_sec: 300
  timeout_sec: 4
  failure_threshold: 10
  success_threshold: 2
  app_start_timeout_sec: 1800

endpoints_api_service:
  name: artise-server.appspot.com
  rollout_strategy: managed

If I go to "Build Cloud" section, all the build have the green check, so they succeed.

If I check the log, the only error I see is about memory:

failed to register layer: Error processing tar file(exit status 1): write /root/.cache/pip/http/0/6/0/1/c/0601ce0a759e906a3c59f237e6f51f593631e6614dfdd40374a20b3e: no space left on device

If i go to the url of the project, the 404 not found page by Google is shown.
And the post request don't return the response. So I think my server is not online.

Best Answer

The First Error ERROR: (gcloud.app.deploy) Error Response: [4] 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. can be due to different things:

  • Not having enough resources
  • Not having permissions in the VPC Network in case you have special VPC configurations.

For the first possibility increasing resources on the app.yaml can be enough.

resources:
 cpu: 2
 memory_gb: 2.3
 disk_size_gb: 10
 volumes:
 - name: ramdisk1
   volume_type: tmpfs
   size_gb: 0.5

For the Second Error: ERROR: (gcloud.app.deploy) Operation [apps/artise-server/operations/a3a9a2ac-f33b-4c94-93f1-88917372703e] timed out. This operation may still be underway.

This can be due deploying again with the same version ID, please try to deploy again with a different version ID, to set the version ID when deploying you can do it by deploying with the following line:

gcloud app deploy --version=VERSION_ID
Related Topic