Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI does not display when serving at port 3000. #4921

Closed
phihung opened this issue Jul 3, 2022 · 4 comments
Closed

UI does not display when serving at port 3000. #4921

phihung opened this issue Jul 3, 2022 · 4 comments
Labels
status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working

Comments

@phihung
Copy link

phihung commented Jul 3, 2022

Summary

Streamlit UI does not display when serving at port 3000

  • When running with --server.port 3000
  • When running inside docker with -p 3000:8501
  • When running with reverse-proxy to port 3000 (ex: in k8s)

Steps to reproduce

# app.py
import streamlit as st
st.text("Hello world")

Docker file

FROM python:3.9
WORKDIR /task
RUN pip install --no-cache-dir streamlit
COPY ./app.py /task/
ENTRYPOINT ["streamlit", "run", "app.py"]

Run locally

streamlit run app.py --server.port 3000

Run with Docker

docker build -t hello .
docker run --rm -p 3000:8501 hello

In K8S

kubectl port-forward my-hello-pod 3000:8501

Everything works fine when changing 3000 to any other port

@phihung phihung added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Jul 3, 2022
@mayagbarnes
Copy link
Collaborator

Hi @phihung! 😃

Thanks for sharing your question! Unfortunately we can't always dig deep and troubleshoot challenges like this on GitHub. We typically use GitHub for feature requests and bug reports.

For troubleshooting help, you can visit our awesome community forums, where thousands of other Streamlit hackers help each other and talk about the amazing things they are creating!

@phihung
Copy link
Author

phihung commented Jul 7, 2022

Hi @mayagbarnes,
I created the ticket as un Bug Report, not an ask for help.
When searching the keyword 3000 in the Issues, I found multiple tickets that may be related to this bug.
But I understand the decision. Thank you for your answer and for the great product.

@guanyilun
Copy link

guanyilun commented Jan 15, 2023

I also ran into this problem today, and I tracked down its cause and I think it's indeed a bug. When you set the server port to 3000, if you check the browser console you will find that it's still trying to access port 8501 for websocket connection which causes errors. The reason it's doing that is that port 8501 is hard-coded as the "development port" (link), and the condition for streamlit to tell that it's in development mode is, interestingly, to check whether the server port is 3000 (link) which I find unreasonable. I think development mode shouldn't be set based on which port the server runs on but through some configuration / environment variable. Can we re-open this issue and fix this?

@mhesler74
Copy link

@mayagbarnes Please re-open this ticket. Streamlit won't function on port 3000 which is a real problem!
See @guanyilun response for the exact issue.
+1 to re-open this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants