Cannot connect to a running endpoint
richardhaven
FREEOP

a day ago

https://eleanorapi-production.up.railway.app/health says it has deployed and the healthcheck passed

When I use that url, it returns a 502

Where do I find troubleshooting steps?

Thanks

Awaiting User Response$10 Bounty

10 Replies

Status changed to Open Railway 1 day ago


Make sure the port your app is listening to is the same port your URL is mapped to. You can change this in the networking section of your service settings.

Also, make sure to listen on 0.0.0.0 instead of localhost.


Status changed to Awaiting User Response Railway 1 day ago


gyanavkhandelwal6396-cmyk
FREETop 10% Contributor

a day ago

its crashing beacuse it is listening to process.env.PORT.

Check the Deployment Logs in Railway and verify your app binds to 0.0.0.0 with a valid /health route.


Status changed to Awaiting Railway Response Railway 1 day ago


Status changed to Awaiting User Response Railway 1 day ago


gyanavkhandelwal6396-cmyk

its crashing beacuse it is listening to process.env.PORT. Check the Deployment Logs in Railway and verify your app binds to 0.0.0.0 with a valid /health route.

richardhaven
FREEOP

9 hours ago

Logs:

INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

Starting Container

INFO: 100.64.0.2:52405 - "GET /health HTTP/1.1" 200 OK

I'm timing out when I try to hit

     https://eleanorapi-production.up.railway.app/health

     https://eleanorapi-production.up.railway.app:8080/health

     https://100.64.0.2:8080/health

what should I try next?

Cheers


Status changed to Awaiting Railway Response Railway about 9 hours ago


0x5b62656e5d

Make sure the port your app is listening to is the same port your URL is mapped to. You can change this in the networking section of your service settings. Also, make sure to listen on `0.0.0.0` instead of `localhost`.

richardhaven
FREEOP

9 hours ago

Logs:

INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

Starting Container

INFO: 100.64.0.2:52405 - "GET /health HTTP/1.1" 200 OK

I'm timing out when I try to hit

 https://eleanorapi-production.up.railway.app/health

 https://eleanorapi-production.up.railway.app:8080/health

 https://100.64.0.2:8080/health

what should I try next?

Cheers


I assume INFO: 100.64.0.2:52405 - "GET /health HTTP/1.1" 200 OK is coming from your codebase.

Something I'd try is to make Uvicorn listen on a different arbitrary port (eg, 3000) and map the URL to that as well. See if that works.


richardhaven
FREEOP

7 hours ago

no, INFO: 100.64.0.2:52405 - "GET /health HTTP/1.1" 200 OK is from Railway. I assume it is the post-deployment health check

My application does not set or otherwise address the port at all. It is a default FastAPI server

Cheers


richardhaven

Logs: INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) Starting Container INFO: 100.64.0.2:52405 - "GET /health HTTP/1.1" 200 OK I'm timing out when I try to hit https://eleanorapi-production.up.railway.app/health https://eleanorapi-production.up.railway.app:8080/health https://100.64.0.2:8080/health what should I try next? Cheers

gyanavkhandelwal6396-cmyk
FREETop 10% Contributor

6 hours ago

app is running correctly inside the container, but Railway likely is not exposing the service publicly on the correct port — make sure the Railway service “Public Networking” is enabled and the exposed port is set to 8080.

100.64.x.x is an internal private Railway IP


gyanavkhandelwal6396-cmyk

app is running correctly inside the container, but Railway likely is not exposing the service publicly on the correct port — make sure the Railway service “Public Networking” is enabled and the exposed port is set to 8080. 100.64.x.x is an internal private Railway IP

richardhaven
FREEOP

4 hours ago

Public Networking

Access your application over HTTP with the following domains

eleanorapi.up.railway.app # (I changed the name)

Port 8000

These fail to connect

https://eleanorapi.up.railway.app/health - 502

https://eleanorapi.up.railway.app:8000/health - eleanorapi.up.railway.app took too long to respond

Cheers


richardhaven

Public Networking Access your application over HTTP with the following domains eleanorapi.up.railway.app # (I changed the name) Port 8000 These fail to connect https://eleanorapi.up.railway.app/health - 502 https://eleanorapi.up.railway.app:8000/health - eleanorapi.up.railway.app took too long to respond Cheers

You need to change your URL to listen to port 8080 instead of 8000.


richardhaven

Public Networking Access your application over HTTP with the following domains eleanorapi.up.railway.app # (I changed the name) Port 8000 These fail to connect https://eleanorapi.up.railway.app/health - 502 https://eleanorapi.up.railway.app:8000/health - eleanorapi.up.railway.app took too long to respond Cheers

gyanavkhandelwal6396-cmyk
FREETop 10% Contributor

21 minutes ago

Change the Railway public port to 8080 (or change your app to run on 8000 using process.env.PORT) and redeploy the service.pp is listening on port 8080, but Railway Public Networking is configured for port 8000


Status changed to Awaiting User Response Railway 21 minutes ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...