2

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.

1

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
| improve this answer | |
0

The error suggests that there might be insufficient resources. Try increasing default values for mermory as described here. Example:

resources:
  cpu: 2
  memory_gb: 2.3
  disk_size_gb: 10
  volumes:
  - name: ramdisk1
    volume_type: tmpfs
    size_gb: 0.5
| improve this answer | |
  • Still got the second error I post above – Nicola Dec 13 '19 at 15:04
0

Are you by any chance deploying with a Virtual Private Cloud? If so, the first error message you are getting suggests the issue might be related to the VPC’s firewall. Can you verify your firewall rules?

| improve this answer | |
  • Where should I check If I'm using a Virtual Private Cloud? Inside the section "AppEngine" --> "Firewall Rules" is all "accept" – Nicola Dec 13 '19 at 15:05
  • Your app might be consuming too many resources and never arriving at a ready state because it's taking too long to load. Try further increasing CPU, disk space and wait time again. Do you get the same error message if you deploy your app on your local machine? – Philippe Dec 13 '19 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.