2013-02-01 31 views
4

我需要運行使用gunicorn的Django應用程序。 我閱讀文檔,我覺得我成立了一切如我應該,但是當我運行GeventSocketIOWorker沒有屬性'套接字'

gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker app.wsgi:application 

我得到以下錯誤消息

2013-02-01 18:25:17 [25394] [INFO] Booting worker with pid: 25394 
2013-02-01 18:25:18 [25394] [ERROR] Exception in worker process: 
Traceback (most recent call last): 
    File ".../app-root/data/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker 
    worker.init_process() 
    File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 131, in init_process 
    super(GeventWorker, self).init_process() 
    File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/base.py", line 104, in init_process 
    self.run() 
    File ".../app-root/data/lib/python2.7/site-packages/socketio/sgunicorn.py", line 14, in run 
    self.socket.setblocking(1) 
AttributeError: 'GeventSocketIOWorker' object has no attribute 'socket' 
Traceback (most recent call last): 
    File ".../app-root/data/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker 
    worker.init_process() 
    File ".../data/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 131, in init_process 
    super(GeventWorker, self).init_process() 
    File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/base.py", line 104, in init_process 
    self.run() 
    File ".../app-root/data/lib/python2.7/site-packages/socketio/sgunicorn.py", line 14, in run 
    self.socket.setblocking(1) 
AttributeError: 'GeventSocketIOWorker' object has no attribute 'socket' 
2013-02-01 18:25:18 [25394] [INFO] Worker exiting (pid: 25394) 

如果我django_socketio運行它,一切工作正常,我必須錯過真正重要的事情。

謝謝您的幫助

回答

9

似乎與gunicorn> 0.17的問題,請參見issue #122。 對我而言,它與gunicorn的版本0.16.1一起工作。

pip install gunicorn==0.16.1 
+2

以防萬一,如果有人想知道,它的2014年10月和這個解決方案仍然有效。謝謝。 – dhilipsiva

0

安裝gevent-socketio 0.3.6可能會修復此問題,而無需在某些情況下恢復gunicorn。我有0.3.5-RC2升級修復了這個問題對我來說(注:這是不是在Django,但它的工作。)

pip install gevent-socketio==0.3.6