相关文章推荐
打酱油的小刀  ·  巧用Excel ...·  1 月前    · 
打酱油的小刀  ·  XMLHttpRequest: ...·  1 月前    · 
打酱油的小刀  ·  Azure API Management ...·  2 月前    · 
打酱油的小刀  ·  Using SSL with a ...·  10 月前    · 
打酱油的小刀  ·  八、Kafka 的 Consumer API·  11 月前    · 
打酱油的小刀  ·  Autopilot device name ...·  11 月前    · 
打酱油的小刀  ·  affinity Input-Output ...·  11 月前    · 
打酱油的小刀  ·  【VC++】Visual ...·  1 年前    · 
愤怒的键盘  ·  【课题总结】OpenCV ...·  20 分钟前    · 
满身肌肉的保温杯  ·  大疆DJI Air ...·  36 分钟前    · 
飘逸的热带鱼  ·  Spring Data JPA - ...·  57 分钟前    · 
玩足球的斑马  ·  System.Runtime.Interop ...·  1小时前    · 

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?
  • Why is it spamming /healthz ?
  • Hi @alee

    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 :nerd_face: . 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 :smiley:

    And just because I spend 5 minutes doing some ASCII art, here’s a diagram of the whole thing:

    (Terminal)                                       (Browser)
    +------------------+                             +------------------+
    | Strealmit server |                             | Streamlit app    |
    |                  |                             |                  |
    | Routes:          |                             |                  |
    | /                |<- HTML/JS/CSS assets -------|                  |
    | /healthz         |<- Server "is-alive" check --|                  |
    | /stream          |<- Websocket connection -----|                  |
    | /message         |<- Packet cache -------------|                  |
    |                  |                             |                  |
    +------------------+                             +------------------+
                  

    Hi @alee

    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.

    github.com/streamlit/streamlit
     
    推荐文章