Hello everybody. Hope you are all doing great!
I am using streamlit for a couple of weeks now and I am facing a problem that I can’t find any solution. And what is really confusing is the fact that this error happens in some situations, but do not in others with the same code/structure.
When i am running my app, It has a cache_data() function where it checks if the file exists in a S3 bucket, if it does not, it just runs a query, saves a .csv file on S3 and cache the data, so while the server is active, the data is being cached and i don’t need to check the S3 bucket nor run the query.
The .csv file mentioned above has its file size around 30mb.
So when i run my app, this error sometimes pops up on console and it seems to bug my application, taking too long to load (and sometimes it does not load at all):
tornado.iostream.StreamClosedError: Stream is closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "xxxxxx/python3.10/site-packages/tornado/websocket.py", line 1090, in wrapper
raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Task exception was never retrieved
future: <Task finished name='Task-1042' coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at xxxxx/python3.10/site-packages/tornado/websocket.py:1086> exception=WebSocketClosedError()>
What I am not understanding is why it happens and why it happens only sometimes, not always.
Any tips on how to solve it? Thank you very much