我无法使用拆分运行状况检查部署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.
我正在关注文档,所以我不确定为什么会在这里触发错误。
我唯一能想到的是我的'网站套餐'可能已经过时了?我不相信我的Docker应该安装任何google/appengine/
库,但我不知道我可能做错了什么。
答案 0 :(得分:0)
所以上述故障情况似乎是gcr.io/google_appengine/python-compat-multicore
泊坞窗图片过时造成的。
github与最新的python文件保持同步,但相关的Docker镜像从未重建过。
我已经修复了这个特殊错误,通过检查github并自己重建docker镜像,并将我的appengine flex内容指向我自己的父内置图像。
(我现在有一个单独的问题,将拆分的健康检查发送到默认路径,并且它不允许我覆盖路径。我已经将其作为Google云问题跟踪器中的错误提交。但至少上述问题是现在为我解决了)