Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with App Engine split health checks

I am unable to deploy my App Engine Flex Python project with split health checks.

I have enabled health checks:

$ gcloud beta app describe
...
featureSettings:
  splitHealthChecks: true

Using the docs as a model, my app.yaml has:

readiness_check:
  path: '/health_check'
  check_interval_sec: 5
  timeout_sec: 4
  failure_threshold: 2
  success_threshold: 2
  app_start_timeout_sec: 600

liveness_check:
  path: '/health_check'
  check_interval_sec: 30
  timeout_sec: 4
  failure_threshold: 2
  success_threshold: 2

But when I deploy, it fails due to the following error:

  File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
    worker.init_process()
  File "/env/local/lib/python2.7/site-packages/gunicorn/workers/gthread.py", line 109, in init_process
    super(ThreadWorker, self).init_process()
  File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
    self.load_wsgi()
  File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/env/local/lib/python2.7/site-packages/vmruntime/wsgi.py", line 48, in <module>
    wsgi_config.get_module_config_filename())
  File "/env/local/lib/python2.7/site-packages/vmruntime/wsgi_config.py", line 48, in get_module_config
    return appinfo_includes.Parse(f)
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/appinfo_includes.py", line 57, in Parse
    appyaml, _ = ParseAndReturnIncludePaths(appinfo_file, open_fn)
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/appinfo_includes.py", line 82, in ParseAndReturnIncludePaths
    appyaml = appinfo.LoadSingleAppInfo(appinfo_file)
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/appinfo.py", line 2417, in LoadSingleAppInfo
    listener.Parse(app_info)
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/yaml_listener.py", line 227, in Parse
    self._HandleEvents(self._GenerateEventParameters(stream, loader_class))
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
    raise yaml_errors.EventError(e, event_object)
EventError: Unexpected attribute 'failure_threshold' for object of type ReadinessCheck.

I'm following the documentation so I'm not sure why it would be triggering an error here.

The only thing I can imagine is that my 'site-packages' is perhaps out of date? I don't believe my Docker should install any google/appengine/ libraries, but I'm at a loss for what I could be doing wrong.

like image 293
Mike Lambert Avatar asked Nov 24 '25 12:11

Mike Lambert


1 Answers

So seems the above failure scenario is caused by the gcr.io/google_appengine/python-compat-multicore docker image being out of date.

The github is up to date with the latest python files, but the associated Docker image was never rebuilt.

I have fixed this particular error by checking out the github and rebuilding the docker image myself, and pointing my appengine flex stuff at my own parent-built-image.

(I now have a separate problem, with split healthchecks being sent to the default paths, and it not letting me override the paths. I have filed that as bug in the Google cloud issue tracker. But at least the above question is now solved for me)

like image 86
Mike Lambert Avatar answered Nov 27 '25 01:11

Mike Lambert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!