2012-09-16 60 views
25

我有一個使用Gunicorn和本地運行良好Django的web應用程序,但是當我部署在EC2上的應用程序,我看到Gunicorn失敗:如何調試gunicorn失敗問題? (工人未能啓動)

$ 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. 

我試着使用--spew進行日誌記錄,但它保持運行並且不顯示錯誤。

如何調試此問題?

回答

26

你需要​​

+7

--debug在gunicorn 19.0中已棄用。請參閱http://gunicorn-docs.readthedocs.org/en/latest/news.html#id28。 – alan

+0

已棄用的更新鏈接是:http://gunicorn-docs.readthedocs.io/en/latest/2014-news.html#id7 –

6

在我來說,我不得不從同一個文件夾我的manage.py文件運行gunicorn_django --bind example.com:8001

24

嘗試運行--preload作爲gunicorn_django的參數 - 它應該顯示工人在啓動時出現的錯誤。請參閱this bug

+0

我一直試圖調試我的服務幾個小時,你剛剛救了我的一天! – Ponytech

+0

很高興聽到它:) –