欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

gunicorn 报错 Worker failed to boot. 解决办法

程序员文章站 2024-02-04 20:14:04
...

以下报错没有详细的信息,不知道代码具体哪里出了问题

Traceback (most recent call last):
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 203, in run
    self.manage_workers()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 545, in manage_workers
    self.spawn_workers()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 617, in spawn_workers
    time.sleep(0.1 * random.random())
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
    self.reap_workers()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

只需要在输入gunicorn命令的时候在后边加上参数 –preload,便可看到详细的报错信息
加上参数后的报错信息如下:

Traceback (most recent call last):
  File "/home/charleswu/.virtualenvs/process/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run
    super(Application, self).run()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/charleswu/.virtualenvs/process/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/home/charleswu/AiDoctor/process_bchao/app.py", line 44, in <module>
    app = create_application()
  File "/home/charleswu/AiDoctor/process_bchao/app.py", line 31, in create_application
    from webapi import image_api
  File "/home/charleswu/AiDoctor/process_bchao/webapi/__init__.py", line 3, in <module>
    from .upload_image import image_api
  File "/home/charleswu/AiDoctor/process_bchao/webapi/upload_image.py", line 9, in <module>
    from interface import get_b_result
  File "/home/charleswu/AiDoctor/process_bchao/interface.py", line 6, in <module>
    from structuration import Struct
  File "/home/charleswu/AiDoctor/process_bchao/structuration.py", line 7, in <module>
    from split_word import desc_list, diag_list
ModuleNotFoundError: No module named 'split_word'

搞定!


相关标签: 解决问题