Connection error when deploying using docker on k8s

I know I have done wiring (service, ingress, port forwarding) correct because I am able to access the landing page of streamlit.

But it shows connection error beyond that.

What am I missing? I tried for searching for other options to provide when doing stream run like --no-browser/--root or anything similar to notebook. but couldn’t find any.

Nothing in the container logs as well:

You can now view your Streamlit app in your browser.
  Network URL: http://192.168.10.84:8501
  External URL: http://13.235.142.175:8501

Anyway, to debug this connection error status?

edit: could be related to this: Hosting streamlit on Heroku which is being worked on, but not sure.

Thanks

Hi yogin16!

Are you also on Heroku? If so, that is likely due to the same issue you linked.

Otherwise, can you open the dev tools in Chrome, then go to the Network tab, right click on the network activity and save a full HAR file? That will let us dig a little deeper into what could be happening.

Hey,

I am running on kubernetes.

Apparently I can’t share .har in this. I would find some way and share it.

Thanks

I made some progress in troubleshooting (I guess)

in network tab I observed that healthz was failing.
Upon checking I saw that it was making a call to http://mydomain.example.com:0/healthz

the :0 is the problem here.
If I manually make a GET call on http://mydomain.example.com/healthz it is returning “ok” with 304

So I am guessing it is somewhere in the config for front-end to get the app address is where the port number “:80” missing?

Let me know if something I can change now easily?

Thanks

Upon checking further I guess 0.47.3 should fix this issue.
Based on the changes I see in frontend/src/lib/UriUtil.ts

I will try it out.

Okay,

0.47.3 fixed the port issue. Yay! :smiley:

But now I see that in the network tab there is always one ws://mydomain.example.com/stream call pending.

So it doesn’t move beyond Please wait... screen.

I will have to now check something which would fix the WebSocket connection.

Hi yogin16,

Can you add

[server]
enableCORS = false

to your ~/.streamlit/config.toml ?

1 Like

It worked!
Thanks :smiley:

Also thanks to you and whole streamlit team for such a lit project :partyparrot:

1 Like

hello! I’m seeing this same issue. my version is streamlit==0.67.1. Does anyone know a workaround?