Streamlit Cloud apps refreshes automatically

Good day,

I have constructed some apps using Streamlit, and until now it was all perfect.

Right now, I am facing a problem with all the apps that are deployed through Streamlit Cloud.
The problem is that every app that I have created now automatically refreshes to the initial configuration, even if I am interacting with some widgets. This has caused a lot of trouble with the user experience of my apps. Even with the ones that previously worked without a problem.

It is not a matter of the browser compatibility, because I have tried using different browsers, and the problem repeats itself.

I don’t know it the problem is related to the memory of the app, or if there is any timing functionality behind that is causing it to constantly refresh.

I would appreciate if anyone could give me an insight into how to solve this issue.

Thanks for your help

1 Like

Hey @postdatacrc,
Thanks for reporting this issue! Your issue might be related to a race condition we had with Streamlit version 1.9 & 1.10 that sometimes leads to the widget state being dropped. We fixed it in 1.11 (see this PR). Is your app running with Streamlit 1.11?

Dear @lukasmasuch, thank you very much for your prompt response!

I was indeed using version 1.10. I will upgrade all my apps to version 1.11 to see if that solves my issue!

Thanks!

1 Like

I also have the same issue with my app refreshing even though I have version 1.11 installed.
The only issue is it refreshing nothing else. If you could help that would be greatly appreciated, thank you.

@MrOmega This seems to be a new issue since this is unexpected to happen in 1.11. It would be great if you could open a new issue on Github and add some information (video of the issue, code snippet to reproduce).

2 Likes

Thank you I will do just that tomorrow morning.

1 Like

Guys where is your app deployed?? I am having also the same issue. It keeps refreshing every 5mins (which is the default request timeout of my server) it is deployed in google cloud run.

upon several research, I found out that in google cloud docs, an app need to return a request. Which is I don’t know how to do it yet.

Same issue here. I dont see this behavior when running locally, but on Steamlit Cloud it refreshes every few minutes, breaking the user’s session and resetting everything.

Is there anyway we can save session settings locally (to a text file maybe), so even though the app refreshes, it can reload from the saved file & we can set the user session again, without having to worry about the app refresh??

I found the solution for google cloud deployed apps. Not for streamlit cloud, sorry.

FOR GOOGLE CLOUD:
In your app control panel, there is a menu with metrics,details, and YAML

YAML (short for “YAML Ain’t Markup Language”) is a human-readable data serialization format. It is often used for configuration files and can be more readable and less verbose than other formats such as JSON and XML.

In Google Cloud Run, you can use YAML files to define and configure Cloud Run services. These YAML files, called cloudbuild.yaml, are used by the Google Cloud Build service to build and deploy containers to Cloud Run.

find the timeoutSeconds spec, that should be set to 300 by default.
Enter Edit mode for this file
Change timeoutSeconds to 3000, for example. 3600 is the max allowed
Then you are asked to change also the name of the template:

spec:template:metadata:name

in my case was energyanalyzer-00014-qel and changed to energyanalyzer-00015-qel

Save and implement again. This solves the issue.

I guess streamlit guys should change this value, as far as I know we cannot configure this param by ourselves.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.