Streamlit app keeps reseting with error

I’m currently experiencing a similar issue:

Traceback (most recent call last):
  File "/home/mar/.local/lib/python3.10/site-packages/tornado/websocket.py", line 1089, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Task exception was never retrieved
future: <Task finished name='Task-898' coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /home/mar/.local/lib/python3.10/site-packages/tornado/websocket.py:1085> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "/home/mar/.local/lib/python3.10/site-packages/tornado/websocket.py", line 1087, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mar/.local/lib/python3.10/site-packages/tornado/websocket.py", line 1089, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError

As for my setup:
I am running my streamlit app using streamlit run app.py. This lets me access my dashboard via the port 8501. I am accessing the dashboard using tailscale, and that is where I am experiencing this problem… If I am accessing the dasboard in my local network it works. Furthermore, the problem happens when I have more than two plotly charts, i.e., putting a third one (in the subplot) generates the problem. So maybe it just takes time to transfer the data but tornado closes the socket? I haven’t found a way to extend the timeout value.

Just been getting this error, I was trying to create a large dataframe and it was too big to handle, I shouldn’t really be using pandas at this dataset size…

Hello There!
I’m using an AWS EC2 instance to run my Streamlit app, and i’m not using any venv to install Streamlit and other dependencies. So the packages were installed in /.local directory. and when i try to run the app i was facing the same error as below

/home/ubuntu/.local/lib/python3.10/site-packages/tornado/websocket.py", 
line 1090, in wrapper raise WebSocketClosedError() tornado.websocket.WebSocketClosedError.

The Solution was changing the "websocket_ping_timeout" value to 300 (default value will be 30) under the tornado settings in the below path

/.local/lib/python3.10/site-packages/streamlit/web/server/server.py

Example snippet:

i donno what else to do pls help out!
I am experiancing same thing

Hey all,

I am also seeing this error.
As it was deployed on vm (windows for me), after some time, it’s getting the error.

Findings:

  1. As it was run on locally - i didn’t get any error.
  2. As we moved to VM, there are chances, that others are interacting to our streamlit app - is this causing the error?

Error

2024-02-17 15:49:37.496 Task exception was never retrieved
future: <Task finished name='Task-111929' coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\tornado\websocket.py:1090> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\tornado\websocket.py", line 1092, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\tornado\websocket.py", line 1094, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
2024-02-17 15:50:15.394 Task exception was never retrieved

I also facing this issue, and it is a hard to reproduce error. It looks like it only happens when the internet connectivity is not so strong (like high packet loss or something), which is why I think your solution might make sense. But just to be sure, did you face this issue again after changing the timeout ?