How to debug gunicorn failure issues? (Worker failed to boot)

我是研究僧i 提交于 2019-12-18 18:51:02

问题


I have a Django web application that uses Gunicorn and runs good locally, but when I deploy app on EC2, I see that Gunicorn is failing:

 $ gunicorn_django -b 127.0.0.1:8000 --settings=myapp.settings.dev --debug --log-level info
 2012-09-16 17:39:24 [28333] [INFO] Starting gunicorn 0.14.6
 2012-09-16 17:39:24 [28333] [INFO] Listening at: http://127.0.0.1:8000 (28333)
 2012-09-16 17:39:24 [28333] [INFO] Using worker: sync
 2012-09-16 17:39:24 [28336] [INFO] Booting worker with pid: 28336
 2012-09-16 17:39:24 [28336] [INFO] Worker exiting (pid: 28336)
 2012-09-16 17:39:24 [28333] [INFO] Shutting down: Master
 2012-09-16 17:39:24 [28333] [INFO] Reason: Worker failed to boot.

I tried logging with --spew but it keeps on running and no error is shown.

How can I debug this issue?


回答1:


Try running with --preload as an argument to gunicorn_django - it should show you the error the workers are having when starting. See this bug




回答2:


You need --debug --log-level debug




回答3:


In my case I had to run gunicorn_django --bind example.com:8001 from the same folder as my manage.py file.



来源:https://stackoverflow.com/questions/12449172/how-to-debug-gunicorn-failure-issues-worker-failed-to-boot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!