Refreshing does not update the app on 1.23.0 and above. It was working fine on 1.22.0 and below.
I am deploying a Streamlit app in Kubernetes with the source file on a mounted NFS share. When I update the source file from another client with the mounted NFS share, the file updates on disk, but refreshing the app does not update the content. However, if I update the file directly from the app server, the content is updated.
I’ve tried 1.23.0 to 1.26.0 with no luck. Downgrading to 1.22.0 fixes the issue. I am using default Streamlit configurations.
Were there changes to how Streamlit watches files for changes that may have broken this behavior?
Steps to reproduce
import streamlit as st
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Deploy streamlit app
Change source file
The app should reflect the changes.
The app does not update. There are no errors.
Thanks for raising this issue. I had noticed the same thing myself and hadn’t had a chance to sit down and find the specific conditions. I’ve raised the issue with the Community Cloud team and will take a further look at this myself when I get I chance. I’ll update this thread if I hear anything. Oops, this wasn’t for Community Cloud, but it could be there is some underlying issue that connects the two, so I’ll still take a look.
Could you try setting the configuration server.fileWatcherType = "poll" to see if it is works for your use case? If not, can you try server.fileWatcherType = "watchdog" (you may need to install it directly)
The caching is used to optimize for performance, which is good, but it relies on the file watcher to work properly. Can we verify whether polling or watchdog is failing? From the previous discussion, it seems like Watchdog is not properly working, so it will be worthwhile to reach out to them.
I believe we check the file every 0.2s based on this implementation. I would assume it would not be a big deal if the number of files is overall small. We do this checking in a thread so it’s not meant to impact the rest of the app.
I’m curious to find out why Watchdog isn’t working properly here. I wonder if there’s a Streamlit bug for watchdog or if there’s a bug in Watchdog itself.
I’m looking at this problem, next week I may have some questions/ask for details to verify that the solution works on your setup
Just to double-check, your hypothesis is that removing modification_time != 0.0 from if expression if modification_time != 0.0 and modification_time <= self._modification_time:
solves problem with poll file watcher for your setup?
After thinking about this a little bit more I came to the conclusion that most probably you meant the whole if statement. In particular, if NFS caches the modification time, we will go inside that if statement and will not handle the event.
The solution that could work best here I think is parametrizing PollFileWatcher, to make it configurable whether it should rely or not to modification time.
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.
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.
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.
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.