Fails while trying to connect to streamlit server in k8. In chrome console I get WebSocket connection to failed: Error during WebSocket handshake: Unexpected response code: 200 and in the UI I get Connection failed with status 200: User healthz is not active. You don't have access to any of healthz's projects.
The stdout logs have no errors. Running 0.47.4.
This may be related to Connection error when deploying using docker on k8s. I already have enableCORS = false set. I also see in network tab a call to http://mydomain.example.com:0/healthz every second, is that normal? Literally every 1s. When I see a chrome preview of one of these calls I also see a User healthz is not active. You don't have access to any of healthz's projects.
So I guess my questions are…
Any ideas?
What exactly is it trying to connect to and how? Do I need to set certain service/ingress/ports in k8?
Can you give a little more information about your Kubernetes setup? Or, even better: can you provide steps to reproduce your setup? (if possible!)
I haven’t seen those error messages before, but I believe they’re coming from somewhere in your k8s infrastructure. It’s hard to tell without knowing your exact setup but my guess is that somewhere in your settings you need to open access to these 3 endpoints: /healthz, /stream, and /message.
Ok, nerd time . In case you’re curious about what those endpoints do, here’s a quick description:
Streamlit apps need to access to a few different routes in the Streamlit server. Most data between the server and the app is communicated via a websocket connection at the /stream endpoint. But before the websocket connection is established (and also any time it goes down), the app continuously pings the server at /healthz to see if should try to reconnect the websocket.
There’s also another endpoint at /message which is used to cache messages sent back and forth between the server and the app. I’m not going to go into much detail about what this does, but the high level bit is that it improves Streamlit’s performance.
This is all probably TMI, but I thought you (or others!) may be curious about why these endpoints exist
And just because I spend 5 minutes doing some ASCII art, here’s a diagram of the whole thing:
Could you verify you’re on Streamlit version 0.47.4?
If you’re hitting http://mydomain.example.com:0/healthz there was a bug fix that landed in 0.47.4 that hits the correct port instead of port 0 as is happening for you now.
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.