Bearle / django-private-chat

(Deprecated - Please check out https://github.com/Bearle/django_private_chat2) Django one-to-one Websocket-based Asyncio-handled chat, developed by Bearle team
ISC License
424 stars 132 forks source link

WebSocket is already in CLOSING or CLOSED state. #20

Open MikVidal opened 6 years ago

MikVidal commented 6 years ago

django-private-chat version: django_private_chat-0.1.6 Django version: (2, 0, 2, 'final', 0) Python version: 3 Operating System: Ubuntu Description I am getting following error in Chrome console.

Failed to execute 'send' on 'WebSocket is already in CLOSING or CLOSED state.

I am Using wss

ravi2007147 commented 5 years ago

I am facing the same issue. It occurs if we leave the chat server open for long time

delneg commented 5 years ago

Can you share the logs maybe ? For how long did you leave it ?

ravi2007147 commented 5 years ago

i created a service and leave it open. What kind of log you needed, is there a place where i can look for log?

ravi2007147 commented 5 years ago

I found this in the log.

Loaded: loaded (/etc/systemd/system/chat.service; disabled; vendor preset: enabled) Active: active (running) since Tue 2018-11-27 15:37:41 UTC; 1 day 23h ago Main PID: 28061 (python) Tasks: 2 Memory: 56.7M CPU: 1.537s CGroup: /system.slice/chat.service └─28061 /home/household/housa/bin/python /home/household/housaproject/manage.py run_chat_server /home/crt/crtlatest/household.pem

Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: res = self._query(query) Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: File "/home/household/household/lib/python3.6/site-packages/MySQLdb/cursors.py", line 412, in _query Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: rowcount = self._do_query(q) Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: File "/home/household/household/lib/python3.6/site-packages/MySQLdb/cursors.py", line 375, in _do_query Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: db.query(q) Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: File "/home/household/household/lib/python3.6/site-packages/MySQLdb/connections.py", line 276, in query Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: _mysql.connection.query(self, query) Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: django.db.utils.OperationalError: (2006, 'MySQL server has gone away') Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: 29.11.18 14:42:37:INFO:Failing the WebSocket connection: 1011 Nov 29 14:42:37 ubuntu-s-1vcpu-1gb-sfo2-01 python[28061]: 29.11.18 14:42:37:DEBUG:server >> Frame(fin=True, opcode=8, data=b'\x03\xf3')

delneg commented 5 years ago

Seems like it's related to https://github.com/aaugustin/websockets/issues/84 Try updating websockets and see if it helps

Avin-Techv commented 5 years ago

I have a similar issue in chrome, but firefox does not show this error. Although in some rare cases this works fine as well.

renzyndrome commented 4 years ago

any updates on this?

rufaidemir commented 3 years ago

and i have this error, how can i fix?

DebbyNj commented 1 year ago

I have this same error on a project I am working on, any idea how to resolve this? Don't want to lose my progress so far.