It seems to be strange that problem miss in another server in ubuntu1804 tf222 docker container.
The only difference between the two devices is that the host system problem occurred is ubuntu 1804 and another is ubuntu 20. They are all using docker to manage python environment in the same images.
Cheerful!! I find a solution after nearly one year.
Other solution just change max_user_watches but not max_user_instances. We should change this config value in similar methods.
Change sysctl.conf in host machine not containers.
sudo nano /etc/sysctl.conf
Add fs.inotify.max_user_instances = 1100000 to the bottom of file and save changes.
Then use sudo sysctl -p to reload config.
It is really strange that I’m stuck for this tiny difference. Luckily it finally worked.
Thanks @seiriosPlus . I hit into the same problem deploying an app to heroku. I haven’t encountered the problem before with the app - hit into it after updating to streamlit 1.13 & python 3.9.15.
Your solution worked after all other suggestions failed (e.g. <1> can’t update the filesystem on heroku so not possible to update max_user_instances and max_user_watches; <2> Setting fileWatcherType = “none” in the [server] section of config.toml didn’t have any effect ).
This appears to be the product of something that VSCode was doing. Here are my comments.
This actually happened to me due to “opening folders” in Visual studio Code. Running on linux. When I started vscode with other streamlit python files open. Then started/Opened a folder project Python/Django from another directory within a larger code directory/repository. However it started adding all the files in the root folder to the watch list.
There are thousands of files in the root from other projects.
~notebooks/work/dev ~notebooks/personal/dev
Each with different projects in them.
The new django projects was ~notebooks/work/dev/djangoproject
Vscode was watching everything all the way down to ~notebooks
Streamlit would then complain. Something akin to too many open file handles.
It took a day or so to realize the culprit. I closed out the folder, and just opened the files from the other streamlit projects and it was fine from then on.
Yes, @Robert_Fleming is correct and is spot on to figuring out the root cause here. VS code eats up a lot of the watched file counts if you add too many folders to your workspace.