简单的静态网页部署在应用程序引擎标准上突然抛出错误



多年来,我一直通过谷歌应用程序引擎标准python设置托管我的静态网站,没有遇到任何问题。今天我开始看到下面的错误。注意:GCP上曾经有一个页面解释如何使用python GAE标准托管静态页面,但我现在找不到了。现在是否建议使用水桶?

gunicorn.errors.HaltServer
Traceback (most recent call last): File "/layers/google.python.pip/pip/bin/gunicorn", line 8, in sys.exit(run()) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/base.py", line 228, in run super().run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run self.halt(reason=inst.reason, exit_status=inst.exit_status) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt self.stop() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop time.sleep(0.1) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld self.reap_workers() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers raise HaltServer(reason, self.WORKER_BOOT_ERROR) gunicorn.errors.HaltServer:

这是我的app.yaml文件:

runtime: python38
service: webapp
handlers:
# site root -> app
- url: /
static_files: dist/index.html
upload: dist/index.html
expiration: "0m"
secure: always
# urls with no dot in them -> app
- url: /([^.]+?)/?$  # urls
static_files: dist/index.html
upload: dist/index.html
expiration: "0m"
secure: always
# everything else
- url: /(.*)
static_files: dist/1
upload: dist/(.*)
expiration: "0m"
secure: always

这个错误只发生在11月17日,此后再也没有发生过,我没有做任何更改。也许这与谷歌应用程序引擎服务器上的一些秘密有关。

请注意,根据app.yaml文件,您正在使用Python 3.8,并且您共享的文档适用于Python 2.7。由于不再支持Python 2,从Python 2迁移到Python 3运行时将帮助您消除错误。

这里的文档将帮助您迁移到Python 3标准运行时。

相关内容

最新更新