502 bad gateway
intellectus-ailabs
PROOP

2 months ago

I am currently deploying my FastAPI application on Railway. The deployment logs show that the container starts successfully and the server is running. The logs display messages such as "Application startup complete" and "Uvicorn running on http://0.0.0.0:8080".

However, when I open the application URL provided by Railway, it shows the message "Application failed to respond". The service status appears as online and initializing, but I am unable to access the application through the public URL.

Could you please help me understand why this might be happening and if there is anything I need to configure differently?

Request ID:

CAjpBI3SR8GXXDGcipRofQ

Request ID:

In7prLLRTrqWb_KxAXC71g

2 Replies

Anonymous
PRO

2 months ago

Same as me! It's happening for serverless modes I assume but just started happening


sam-a
EMPLOYEE

2 months ago

Your service must listen on the port defined by the PORT environment variable that we inject at runtime. If your Uvicorn command hardcodes port 8080, it may not match the port we expect. Update your start command to use --port $PORT (e.g., uvicorn main:app --host 0.0.0.0 --port $PORT) or set a PORT service variable to 8080 in your service settings. More details here: Public Networking.


Status changed to Awaiting User Response Railway 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...