django-private-chat icon indicating copy to clipboard operation
django-private-chat copied to clipboard

WebSocket is already in CLOSING or CLOSED state.

Open MikVidal opened this issue 6 years ago • 9 comments

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

MikVidal avatar Jun 16 '18 18:06 MikVidal

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

ravi2007147 avatar Nov 20 '18 17:11 ravi2007147

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

delneg avatar Nov 20 '18 18:11 delneg

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 avatar Nov 21 '18 09:11 ravi2007147

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')

ravi2007147 avatar Nov 29 '18 14:11 ravi2007147

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

delneg avatar Nov 30 '18 04:11 delneg

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

Avin-Techv avatar Apr 03 '19 06:04 Avin-Techv

any updates on this?

renzyndrome avatar May 08 '20 13:05 renzyndrome

and i have this error, how can i fix?

rufaidemir avatar Nov 13 '20 13:11 rufaidemir

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.

DebbyNj avatar Nov 18 '22 07:11 DebbyNj