多年來,我一直通過谷歌應用引擎標準 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
uj5u.com熱心網友回復:
請注意,您根據app.yaml檔案使用 Python 3.8 ,并且您共享的檔案適用于 Python 2.7。由于不再支持 Python 2,從 Python 2 遷移到 Python 3 運行時將幫助您消除錯誤。
此處的檔案將幫助您遷移到 Python 3 標準運行時。
uj5u.com熱心網友回復:
此錯誤僅在 11 月 17 日發生,此后不再發生,我沒有任何更改。也許它與谷歌應用引擎服務器上的一些秘密有關。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/361597.html
標籤:谷歌应用引擎
