gunicorn.errors.HaltServer

gunicorn报错gunicorn.errors.HaltServer:
 
[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 
    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:    ##报错,但看不出具体原因

 

直接看日志看不出具体的错误, 需要在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 
    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 
  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 
  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 
  File "/opt/di/server/diserver/report/ioc_analyze_report.py", line 42, in ReportBase
NameError: name 'cwd' is not defined         ##可以看到具体的错误是因为cwd参数未定义      

 

 
 

你可能感兴趣的:(gunicorn.errors.HaltServer)