streamlit app 502 not responding
fuad47
HOBBYOP

6 months ago

Healthcheck fails and domain page displays 502 bad gateway.
healthcheck path: /health
port is manually set: 8501

app domain is : https://paperquery.up.railway.app

config file content:
[server]

port = 8501

address = "0.0.0.0"

headless = true

enableCORS = false

enableXsrfProtection = false

maxUploadSize = 20

maxMessageSize = 20

[browser]

gatherUsageStats = false

[theme]

primaryColor = "#1f77b4"

backgroundColor = "#ffffff"

secondaryBackgroundColor = "#f0f2f6"

textColor = "#262730"

Solved$10 Bounty

Pinned Solution

Your health check is failing because Streamlit doesn't have a /health endpoint. In Railway settings: change health check path from /health to / (or remove it), set start command to streamlit run app.py --server.port=$PORT --server.address=0.0.0.0, and ensure the port is set to $PORT (not 8501). Railway assigns ports dynamically, so you must use their PORT environment variable, not a hardcoded port.

4 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Your health check is failing because Streamlit doesn't have a /health endpoint. In Railway settings: change health check path from /health to / (or remove it), set start command to streamlit run app.py --server.port=$PORT --server.address=0.0.0.0, and ensure the port is set to $PORT (not 8501). Railway assigns ports dynamically, so you must use their PORT environment variable, not a hardcoded port.


fra
HOBBYTop 10% Contributor

6 months ago

Can you please try using port 8080? Be sure the port set in railway match the one exposed by your app


dostogircse171

Your health check is failing because Streamlit doesn't have a /health endpoint. In Railway settings: change health check path from /health to / (or remove it), set start command to streamlit run app.py --server.port=$PORT --server.address=0.0.0.0, and ensure the port is set to $PORT (not 8501). Railway assigns ports dynamically, so you must use their PORT environment variable, not a hardcoded port.

fuad47
HOBBYOP

6 months ago

I removed port setting from config.toml file, updated git repo and added that start command as you stated, it solved, problem was assigning port in config.toml file and manually in network settings.


Status changed to Open brody 6 months ago


Status changed to Open ray-chen 3 months ago


Status changed to Solved ray-chen 3 months ago


Loading...