1.启动报错 Worker failed to boot.
(py2) [root@localhost ~]# gunicorn -c python:api.config.gunicorn api.init:api
[2020-11-29 00:02:56 +0000] [30522] [INFO] Starting gunicorn 19.7.1
[2020-11-29 00:02:56 +0000] [30522] [INFO] Listening at: http://127.0.0.1:8001 (30522)
[2020-11-29 00:02:56 +0000] [30522] [INFO] Using worker: eventlet
[2020-11-29 00:02:56 +0000] [30533] [INFO] Booting worker with pid: 30533
[2020-11-29 00:02:59 +0000] [30522] [INFO] Shutting down: Master
[2020-11-29 00:02:59 +0000] [30522] [INFO] Reason: Worker failed to boot.
- 加上–preload 显示报错详情
(py2) [root@localhost ~]# gunicorn -c python:api.config.gunicorn api.init:api --preload
Traceback (most recent call last):File "/home/vackbot/venvs/py2/bin/gunicorn", line 8, in <module>sys.exit(run())File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in runWSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/base.py", line 203, in runsuper(Application, self).run()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in runArbiter(self).run()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/arbiter.py", line 60, in __init__self.setup(app)File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/arbiter.py", line 120, in setupself.app.wsgi()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgiself.callable = self.load()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in loadreturn self.load_wsgiapp()File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiappreturn util.import_app(self.app_uri)File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app__import__(module)File "/home/vackbot/venvs/py2/lib/python2.7/site-packages/vb_api-3.1.2.dev3-py2.7.egg/api/init.py", line 39, in <module>from api.websockets.message import MessageNamespaceFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/vb_api-3.1.2.dev3-py2.7.egg/api/websockets/message.py", line 3, in <module>from flask_socketio import emitFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/flask_socketio/__init__.py", line 16, in <module>import socketioFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/socketio/__init__.py", line 3, in <module>from .client import ClientFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/socketio/client.py", line 7, in <module>import engineioFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/engineio/__init__.py", line 3, in <module>from .client import ClientFile "/home/vackbot/venvs/py2/lib/python2.7/site-packages/engineio/client.py", line 2, in <module>from json import JSONDecodeError
ImportError: cannot import name JSONDecodeError
(py2) [root@localhost ~]#