App stuck in "Please Wait" Ubuntu 18.04

Hello,

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.

What other configurations do I need to change?

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.

See here for a complete working example you can test in binder (vscode is the app being proxied): GitHub - ml-starter-packs/microservice-workshop: interactive coding environment for microservices demo

What does my post have to do with microservices? What do you mean “notebook”?

I am having a really hard time understanding your post unfortunately, maybe I just need more information.

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.

Here’s an example leveraging the same pattern but for streamlit (look inside the binder folder for the relevant content): GitHub - ml-starter-packs/mlflow-viz: streamlit app for comparing and visualizing A/B test results from a selection of MLflow runs.

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)

Hey,

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

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:8501/$1 [P,L]

RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) localhost:8501//$1 [P,L]

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.