Skip to content

WebSocketClosedError #3565

@memalhot

Description

@memalhot

Our JupyterLab servers have been getting this error:

Exception in callback BaseAsyncIOLoop._handle_events(16, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(16, 1)>
Traceback (most recent call last):
  File "/usr/lib64/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/opt/app-root/lib64/python3.11/site-packages/tornado/platform/asyncio.py", line 202, in _handle_events
    handler_func(fileobj, events)
  File "/opt/app-root/lib64/python3.11/site-packages/terminado/management.py", line 265, in pty_read
    client.on_pty_read(s)
  File "/opt/app-root/lib64/python3.11/site-packages/terminado/websocket.py", line 81, in on_pty_read
    self.send_json_message(["stdout", text])
  File "/opt/app-root/lib64/python3.11/site-packages/terminado/websocket.py", line 86, in send_json_message
    self.write_message(json_msg)
  File "/opt/app-root/lib64/python3.11/site-packages/jupyter_server_terminals/handlers.py", line 67, in write_message
    super().write_message(message, binary=binary)
  File "/opt/app-root/lib64/python3.11/site-packages/tornado/websocket.py", line 332, in write_message
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError

These logs occur even when the user is interacting with the terminal and there is no reason for the socket to close. It leads to lag, dropped keystrokes, and some other issues for our users.

Has this been seen before?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions