I am trying to deploy a python application and I am receiving the following error message:
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.
My app.yaml is:
runtime: python
runtime_config:
python_version: 3
env: flex
service: newservice
handlers:
- url: /
script: hello.py
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
I believe the problem is related to the yaml file, since I have deployed a sample application previously with no problems (using entrypoint on my yaml), then when I added a new python script and referred to it on the yaml file (using the handlers, to run my message block) I started to get this error.
Edit: after GAEFan's answer my hello has included a handler for readiness_check as:
def post():
self.response.headers['Content-Type'] = 'application/json'
obj = {
'status': 200,
}
self.response.out.write(json.dumps(obj))
webapp2.WSGIApplication([
('/readiness_check', post())
], debug=True)