Skip to content

Instantly share code, notes, and snippets.

@jsam
Created August 21, 2012 00:07
Show Gist options
  • Save jsam/3409561 to your computer and use it in GitHub Desktop.
Save jsam/3409561 to your computer and use it in GitHub Desktop.
django-gevent-sockeiot chat example error
Listening on http://127.0.0.1:9001 and on port 843 (flash policy server)
DEPRECATION WARNING: use `namespace` instead of `resource`
FAILED to start flash policy server: [Errno 13] Permission denied: ('0.0.0.0', 843)
Traceback (most recent call last):
File "/home/sam/.virtualenvs/socketio/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 438, in handle_one_response
self.run_application()
File "/home/sam/.virtualenvs/socketio/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 424, in run_application
self.result = self.application(self.environ, self.start_response)
File "/home/sam/.virtualenvs/socketio/src/django/django/core/handlers/wsgi.py", line 239, in __call__
signals.request_finished.send(sender=self.__class__)
File "/home/sam/.virtualenvs/socketio/src/django/django/dispatch/dispatcher.py", line 167, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/sam/.virtualenvs/socketio/src/django/django/db/__init__.py", line 46, in close_connection
conn.close()
File "/home/sam/.virtualenvs/socketio/src/django/django/db/backends/sqlite3/base.py", line 340, in close
self.validate_thread_sharing()
File "/home/sam/.virtualenvs/socketio/src/django/django/db/backends/__init__.py", line 142, in validate_thread_sharing
% (self.alias, self._thread_ident, thread.get_ident()))
DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id -1217471744 and this is thread id 152761644.
<SocketIOServer fileno=3 address=0.0.0.0:9001>: Failed to handle request:
request = GET / HTTP/1.1 from ('127.0.0.1', 35052)
application = <django.core.handlers.wsgi.WSGIHandler object at 0xb739ba2c>
127.0.0.1 - - [2012-08-20 20:06:48] "GET / HTTP/1.1" 500 161 0.060936
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
Traceback (most recent call last):
File "/home/sam/.virtualenvs/socketio/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 438, in handle_one_response
self.run_application()
File "/home/sam/.virtualenvs/socketio/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 424, in run_application
self.result = self.application(self.environ, self.start_response)
File "/home/sam/.virtualenvs/socketio/src/django/django/core/handlers/wsgi.py", line 239, in __call__
signals.request_finished.send(sender=self.__class__)
File "/home/sam/.virtualenvs/socketio/src/django/django/dispatch/dispatcher.py", line 167, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/sam/.virtualenvs/socketio/src/django/django/db/__init__.py", line 46, in close_connection
conn.close()
File "/home/sam/.virtualenvs/socketio/src/django/django/db/backends/sqlite3/base.py", line 340, in close
self.validate_thread_sharing()
File "/home/sam/.virtualenvs/socketio/src/django/django/db/backends/__init__.py", line 142, in validate_thread_sharing
% (self.alias, self._thread_ident, thread.get_ident()))
DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id -1217471744 and this is thread id 152761724.
<SocketIOServer fileno=3 address=0.0.0.0:9001>: Failed to handle request:
request = GET /favicon.ico HTTP/1.1 from ('127.0.0.1', 35053)
application = <django.core.handlers.wsgi.WSGIHandler object at 0xb739ba2c>
@nieldomingo
Copy link

were you able to find a fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment