I launched an app recently through Streamlit Cloud.
Everything looked OK at first sight, but recently, visitors from the app warned me about an automatic page refresh, triggered after several minutes of inactivity on the URL.
Did this happen to anyone?
Is there a way to block this auto-refresh (I have not seen anything in the app settings) ?
Iām seeing a similar issue. For mine, the deployed app fully auto-refreshes when the user is interacting with input widgets. The goal of my app is to allow users to vary a large number of input parameters and run a simulation, but the users are not able to enter all the parameters before the page refreshes itself. I donāt see the issue when I run locally on my machine ā it seems to be an artifact of the streamlit cloud deployment. I too would like to block the auto-refresh, if it is possible. Could this be a deployment container issue?
Same here. Sometimes I get kicked out right away, sometimes after a few minutesā¦ the logs look like itās updating the code from GitHub every so often even if there are no changes.
I put up a post about this yesterday. So far no solutions:
Hmmā¦ I tried wrapping my streamlit app in a local docker container to see if I could host it myself. In my case, it doesnāt seem like it would reach out to Github. But even when I run the local docker container, I am seeing the same issue as on the streamlit cloud with the page refreshing. In my case, when I try interacting too quickly with any of the numeric inputs (e.g., rapidly clicking an increment button), it completely refreshes the page and resets the session state. Could it be an issue with running streamlit from a linux container? I donāt seem to have any issues when I run it locally from my windows or mac machines. But running from a docker container or streamlit cloud both generate the bug.
I have the same problem! I have a lot of widgets in my app and the user often canāt even interact with all of them and press āsubmitā because the page refreshes at random times and the session state is reset. I have checked for memory leakage / performance issues but that does not seem to be the issue
@tommaso-moro@giddyphysicist Can you both check if you are running Streamlit version >= 1.11? If refresh is triggered by some interactions with widgets, it might be related to a widget loss issue we had in version 1.9 and 1.10.
@lukasmasuch , thank you! I had been using version 1.10. Updating to 1.11.1 seems to have fixed it for me (both locally in a docker container and on the newly released cloud version). Iām waiting to get some feedback from the app users, but for now the version update seems to have fixed it. Thanks so much!
Hello Charly, I am having the same issue. However the app is deployed in google cloud platform.
upon several research I found out that in google cloud, the app need to return a request. so basically my app keep hitting the request timeout.
Same thing here.
My app works perfect in local, but when deployed to google cloud it refreshes automatically every 1.5 to 5 minutes randomly.
This refresh deletes all the things done or selected by the user, which i think is a serious bug.
Looks like it happens in streamlit cloud and google cloud, so not a one cloud system issue.
I have try a couple of workarounds but none of them worked.
a) first workaround, set this in the config.toml file
[server]
runOnSave = true
b) second workaround: set a ping to a random server at the end of my code, with a sleep time of 5 sec. this way the app is always active and you can make sure of it as the running icons on the top right corner are moving. But didnĀ“t work.
Also thought this could be a browser issue (browsers auto refresh tabs normally), so I took a tab in chrome to run the app, and disabled the auto refresh options of the browser. But didnĀ“t work either.
There is another discussion with the same topic here:
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.
Same problem here. Any workarounds or permanent fixes? I have a web app which can run for a long time I donāt want the webpage to refresh until the job is done
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking āAccept allā, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.