We are attempting to deploy a Streamlit app and are stuck on the “Please wait…” loading message. The following technical details are important:
Deploying on an Ubuntu 18.04.6
Streamlit version 1.12.0
Python version 3.9.7
We are deploying through The Littlest JupyterHub, specifically following this guide after reading about the technique on the forums.
Currently, our command we are using to launch our app is: streamlit run filepath_to_app/main.py --server.port port_number server.headless True --server.enableCORS False --global.developmentMode False --server.enableWebsocketCompression False --port port_number and yet the issue remains.
We did notice a similar post, but we are already on that python version.
For me the key to running any other web app (streamlit included) via jupyterhub is to employ the package jupyter-server-proxy and use a config file for the notebook.
It doesn’t, but the architecture there is the same. That was just a repo I used for an educational workshop on the microservice topic, but to enable it I needed to be able to proxy services running in the jupyter container.
Take a look at the requirements, which include “jupyter-server-proxy,” which I think is what you’re missing. Then to access a service at a url, you’d refer to the setup in the jupyter_notebook_config.py file and notice the directory to which it’s copied in the Dockerfile.
The Dockerfile shows a complete example of deploying a web app (vscode) proxied through jupyter, which is the same pattern you need for streamlit.
You’d swap the notebook config file contents to launch your streamlit app instead of starting vscode, then access it at the given url.
The binder link demonstrates running streamlit through jupyter, which is exactly your use case. Apologies I didn’t think of this repo first, but I thought the completeness of the Dockerfile in the other one would be helpful.
I realized after rereading your comment that youre able to already proxy the process as you see a loading screen, so the error must be in the startup options for streamlit or the versions of packages involved. At the very least, the startup url in the former repo’s config file should help you see how I was able to run streamlit and access it.
Simply this seems to have been enough:
command": [“streamlit”, “run”, “app.py”],
But the build image differs a bit, as may the specific streamlit version (again, all documented in the binder folder)
I do have a similar problem. I like to host my streamlit app on a local server under ubuntu 22.04, streamlit 1.22, python 3.10.11, apache 2.4.52
I set up the ssl configuration for port 443. This works as expected.
I then set up a proxy to redirect from 443 to 8501 (where my streamlit app runs).
This is where I encounter the problem that the app is stuck on ‘please wait…’
I tried the troubleshooting here App is not loading when running remotely - Streamlit Docs
I added the option --server.enableXsrfProtection=false to --server.enableCORS=false to avoid it being overridden. However, neither deactivating CORS protection, nor websocket compression solved this issue. Since I read that there could be an issue with websocket compression in apache, I also tried to add this in the configuration file by
I’m fairly certain the app runs as expected (I use a minimal version without funcitonality or formatting); as does the server. There seems to be a communication issue that I can’t figure out.
Since this is a known issue, maybe there’s some news on a solution? I’m grateful for any hint.
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.