TypeError on some client disconnects #1

Closed
opened 2022-01-13 22:57:50 +00:00 by skeh · 1 comment
Owner
Traceback (most recent call last):
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 344, in send
    self.send_frame(message, opcode)
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 318, in send_frame
    raise WebSocketError(MSG_ALREADY_CLOSED)
geventwebsocket.exceptions.WebSocketError: Connection is already closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/handler.py", line 75, in run_application
    self.run_websocket()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/handler.py", line 52, in run_websocket
    list(self.application(self.environ, lambda s, h, e=None: []))
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask_sockets.py", line 41, in __call__
    handler(environment, **values)
  File "/home/skeh/Projects/Vtube/twitch_webhook_mirror/app.py", line 17, in client_websocket
    ws.send(secret)
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 347, in send
    raise WebSocketError(MSG_SOCKET_DEAD)
geventwebsocket.exceptions.WebSocketError: Socket is dead
2022-01-13T22:57:20Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '33110', 'HTTP_HOST': '127.0.0.1:8000', (hidden keys: 27)} failed with WebSocketError

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done
    return handle(*args_tuple)
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 1577, in handle
    handler.handle()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 464, in handle
    result = self.handle_one_request()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 694, in handle_one_request
    self.handle_one_response()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 1024, in handle_one_response
    self.log_request()
  File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask_sockets.py", line 109, in log_request
    if '101' not in self.status:
TypeError: a bytes-like object is required, not 'str'
2022-01-13T22:57:20Z <Greenlet at 0x7ff43d1266a0: _handle_and_close_when_done(<bound method WSGIServer.handle of <PyWSGIServer a, <bound method StreamServer.do_close of <PyWSGIServ, (<gevent._socket3.socket [closed] at 0x7ff43cbc84c)> failed with TypeError
``` Traceback (most recent call last): File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 344, in send self.send_frame(message, opcode) File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 318, in send_frame raise WebSocketError(MSG_ALREADY_CLOSED) geventwebsocket.exceptions.WebSocketError: Connection is already closed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 999, in handle_one_response self.run_application() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/handler.py", line 75, in run_application self.run_websocket() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/handler.py", line 52, in run_websocket list(self.application(self.environ, lambda s, h, e=None: [])) File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__ return self.wsgi_app(environ, start_response) File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask_sockets.py", line 41, in __call__ handler(environment, **values) File "/home/skeh/Projects/Vtube/twitch_webhook_mirror/app.py", line 17, in client_websocket ws.send(secret) File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/geventwebsocket/websocket.py", line 347, in send raise WebSocketError(MSG_SOCKET_DEAD) geventwebsocket.exceptions.WebSocketError: Socket is dead 2022-01-13T22:57:20Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '33110', 'HTTP_HOST': '127.0.0.1:8000', (hidden keys: 27)} failed with WebSocketError Traceback (most recent call last): File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done return handle(*args_tuple) File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 1577, in handle handler.handle() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 464, in handle result = self.handle_one_request() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 694, in handle_one_request self.handle_one_response() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib64/python3.9/site-packages/gevent/pywsgi.py", line 1024, in handle_one_response self.log_request() File "/home/skeh/.local/share/virtualenvs/twitch_webhook_mirror-01wIe4c4/lib/python3.9/site-packages/flask_sockets.py", line 109, in log_request if '101' not in self.status: TypeError: a bytes-like object is required, not 'str' 2022-01-13T22:57:20Z <Greenlet at 0x7ff43d1266a0: _handle_and_close_when_done(<bound method WSGIServer.handle of <PyWSGIServer a, <bound method StreamServer.do_close of <PyWSGIServ, (<gevent._socket3.socket [closed] at 0x7ff43cbc84c)> failed with TypeError ```
Author
Owner

Fxied by 228959a

Fxied by 228959a
skeh closed this issue 2022-01-15 08:43:25 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: skeh/flask-sockets#1
No description provided.