App Engine 拆分运行状况检查出错

Error with App Engine split health checks

我无法通过拆分运行状况检查来部署我的 App Engine Flex Python 项目。

我启用了健康检查:

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

使用 docs 作为模型,我的 app.yaml 有:

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

但是当我部署时,由于以下错误而失败:

  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.

我正在关注文档,所以我不确定为什么它会在此处触发错误。

我唯一能想到的是我的'site-packages'可能已经过时了?我不相信我的 Docker 应该安装任何 google/appengine/ 库,但我不知道我可能做错了什么。

所以上面的失败场景似乎是由于 gcr.io/google_appengine/python-compat-multicore docker 图片过时造成的。

github 与最新的 python 文件保持同步,但相关的 Docker 映像从未重建。

我已通过检查 github 并自己重建 docker 图像,并将我的 appengine flex 内容指向我自己的 parent-built-image.[=12= 来修复此特定错误]

(我现在有一个单独的问题,拆分健康检查被发送到默认路径,它不允许我覆盖路径。我已将其作为 Google 云问题跟踪器中的错误归档。但是至少上面的问题现在为我解决了)