gunicorn.errors.HaltServer

gunicorn報錯gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
 
[root@zq ~]# gunicorn --reload --bind=127.0.0.1:5013 --workers=4 --timeout 180 logquery_service:app
[2020-06-18 13:46:38 +0000] [2068] [INFO] Starting gunicorn 19.7.1
[2020-06-18 13:46:38 +0000] [2068] [INFO] Listening at: http://127.0.0.1:5013 (2068)
[2020-06-18 13:46:38 +0000] [2068] [INFO] Using worker: sync
[2020-06-18 13:46:38 +0000] [2073] [INFO] Booting worker with pid: 2073
[2020-06-18 13:46:38 +0000] [2079] [INFO] Booting worker with pid: 2079
[2020-06-18 13:46:38 +0000] [2085] [INFO] Booting worker with pid: 2085
[2020-06-18 13:46:38 +0000] [2091] [INFO] Booting worker with pid: 2091
/opt/poc/lib/python2.7/site-packages/grequests.py:21: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)
/opt/di/server/diserver/IOC/ioc_investigation.py:8: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
/opt/poc/lib/python2.7/site-packages/grequests.py:21: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)
/opt/di/server/diserver/IOC/ioc_investigation.py:8: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
/opt/poc/lib/python2.7/site-packages/grequests.py:21: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)
/opt/di/server/diserver/IOC/ioc_investigation.py:8: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
/opt/poc/lib/python2.7/site-packages/grequests.py:21: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)
/opt/di/server/diserver/IOC/ioc_investigation.py:8: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
Traceback (most recent call last):
  File "/opt/poc/bin/gunicorn", line 9, in <module>
    load_entry_point('gunicorn==19.7.1', 'console_scripts', 'gunicorn')()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/base.py", line 203, in run
    super(Application, self).run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 231, in run
    self.halt(reason=inst.reason, exit_status=inst.exit_status)
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 344, in halt
    self.stop()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 393, in stop
    time.sleep(0.1)
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
    self.reap_workers()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>   ##報錯,但看不出具體原因

 

直接看日誌看不出具體的錯誤,需要在gunicorn命令後邊加上--preload參數,便可查看詳細的報錯信息
[root@zq ~]# gunicorn --preload --bind=127.0.0.1:5013 --workers=4 --timeout 180 logquery_service:app
/opt/poc/lib/python2.7/site-packages/grequests.py:21: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)
/opt/di/server/diserver/IOC/ioc_investigation.py:8: MonkeyPatchWarning: Patching more than once will result in the union of all True parameters being patched
Traceback (most recent call last):
  File "/opt/poc/bin/gunicorn", line 9, in <module>
    load_entry_point('gunicorn==19.7.1', 'console_scripts', 'gunicorn')()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/base.py", line 203, in run
    super(Application, self).run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/opt/poc/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/opt/di/server/logquery_service.py", line 29, in <module>
  File "/opt/poc/lib/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
  File "/opt/di/server/diserver/report/ioc_report_handler.py", line 5, in <module>
  File "/opt/poc/lib/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
  File "/opt/di/server/diserver/report/ioc_analyze_report.py", line 32, in <module>
  File "/opt/di/server/diserver/report/ioc_analyze_report.py", line 42, in ReportBase
NameError: name 'cwd' is not defined         ##可以看到具體的錯誤是因爲cwd參數未定義      

 

 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章