本文介绍了GeventSocketIOWorker没有属性'socket'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要运行Django应用程序,使用gunicorn。
我阅读文档,我想我设置了一切,就像我应该,但是当我运行

I need to run Django application using gunicorn.I read documentation, and I think I set up everything like I should, but when I run

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运行它,一切都可以正常工作,我必须想念一些真正的imp ortant。

If I run it with django_socketio, everything works fine, I must miss something really important.

感谢您的帮助

推荐答案

似乎是枪支> 0.17的问题,请参阅。
对于我来说,它使用的是爆炸物版本0.16.1。

Seems to be a problem with gunicorn>0.17, see issue #122.For me it's working with the version 0.16.1 of gunicorn.

pip install gunicorn==0.16.1

这篇关于GeventSocketIOWorker没有属性'socket'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 20:49