Connection timed out

When accessing my Streamlit app, via a Satellite Internet connection, I get “Please wait” then, after a while, a popup saying “Connection Error” - “Connection times out”. I do NOT have any issues connecting to and using this application via other forms internet access. And my co-workers can access it without issue.

  • Note that this Steamlit app is running in a container in a GCP VM inside our VPN.
  • I tried the solutions provided at Symptom #2: The app says “Please wait…” forever to no avail.
  • I also output all the streamlit configs but am unable to find any type of ‘timeout’ params etc.
  • I am guessing this has something to do with the high latency of Satellite internet.
  • Streamlit version=0.62.1

Any help with this will be greatly appreciated. Thanks.

Hi @dplutchok -

This sort of sounds like what this issue is describing:

Not sure if there are any other specifics that @karriebear might need, but she might be able to work with you to solve your solution and inform the larger solution.

Best,
Randy

Hi @dplutchok! I remember seeing a similar issue that was related to websocket compression. In my case I had a reverse proxy that was stripping out some headers on the requests to and responses from the Streamlit app, and it broke the websocket compression feature. I would see the browser repeatedly trying to connect to the Streamlit server using the developer tools in my browser, and eventually timing out.

To check if you are running into the same issue, you can try setting the server.enableWebsocketCompression config flag to false in your Streamlit app’s config file, or set the STREAMLIT_SERVER_ENABLE_WEBSOCKET_COMPRESSION environment to "false". See docs for more info on config options.

Cheers,
Amey

1 Like

I already tried the solutions in the documentation including adding --server.enableCORS=false to my usual streamlit run command and also --server.enableCORS=false but neither of these made any difference. Should I try something else?

Do you know if there is any type of timeout configuration that can be set on the server.

Note that I continue to have this issues when utilizing my home satellite network and can now confirm that I get this same error when using my cell phone as a hotspot. The issue appears to be correlated with high-latency networks (e.g. >500 ms latency). This is NOT specific to my streamlit app as I actually experience this exact same issue for all streamlit apps available on the web when I am using a high-latency network. Please let me know if there might be some sort of server setting that can overcome this issue. Thanks.

Hi @dplutchok – thanks for following up on this one.

At present there isn’t a configuration you can set to adjust tolerance for latency. I’ll be looking into this one towards the end of this week (i.e. tomorrow), because we’re looking at upgrading our Tornado dependency pretty soon, which might afford us the ability to create a setting that would help in your situation.

Thanks for filing the GitHub issue, too! Linked here:

Thanks for the attention to this issue! FYI, you probably hear this a lot but love streamlit.

2 Likes

Any progress on this issue? e.g. making it user configurable?

Any news about this issue, @dplutchok? I’ve faced the same one nowadays.
Thanks!

Nothing that I am aware of.

Hello, any update on the low latency issue.

1 Like

Hey Team,
I found the solution for high latency network (Ex. Hughes, Latency is grater than 500ms). for Streamlit, version 1.3.0

Solution: Steps:

  1. Go to the Streamlit js folder, which is at following location for windows pc,

C:\Users<username>\PycharmProjects\pythonProject\venv\Lib\site-packages\streamlit\static\static\js

  1. Open the main.c08d602e.chunk.js file
  2. Find time period by searching “1e3” replace time out period which is “1e3” with “1e4”.
  3. Save the js file and rerun the Streamlit app file.

Thank you.

Wow, that’s a heck of a work-around. I will have to try that out when I’m back in my location that uses Hughes satellite. Thanks! Not sure how the heck you figured that one out.

Hi, did you manage to solve this issue?

FYI, I did not implement this or resolve my issue, however, since moving from Huges to Starlink this has become a non-issue. Starlink latency is extremely low.