Application failed to respond

Hey guys. So I'm building a simple FastAPI application connected with Zapier to summarise incoming newsletters to a Notion db. The app seems to have run as I do get: INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:10000 (Press CTRL+C to quit) in deploy logs. But on the hosted URL, I get Application failed to respond and on Zapier I get a 502 error. I have added the start command uvicorn main:app --host 0.0.0.0 --port 10000 for the FastAPI app. Any help appreciated thanks
Solution:
uvicorn main:app --host 0.0.0.0 --port $PORT
uvicorn main:app --host 0.0.0.0 --port $PORT
Jump to solution
12 Replies
Percy
Percy2y ago
Project ID: N/A
Brody
Brody2y ago
I see the problem, can you provide me with your current start command so I can fix it up?
bulletz4breakfast
Start command: uvicorn main:app --host 0.0.0.0 --port 10000
Solution
Brody
Brody2y ago
uvicorn main:app --host 0.0.0.0 --port $PORT
uvicorn main:app --host 0.0.0.0 --port $PORT
Brody
Brody2y ago
there ya go railway assigns the PORT variable to what it expects your app to be listening on, otherwise railway won't know how to connect to your app and you will see the railway error page
bulletz4breakfast
Oh so I should replace it with $PORT?
Brody
Brody2y ago
I have already done that for you, use the start command I sent
bulletz4breakfast
Ohh I see.. thanks lemme try it
Brody
Brody2y ago
if you wanna read a slightly more in depth explanation on this, you can check out this docs page https://docs.railway.app/troubleshoot/fixing-common-errors
bulletz4breakfast
Thanks a lot Brody this worked. I'm getting some logical issues which I'll look into but really appreciate the quick and prompt resolution!
Brody
Brody2y ago
no problem, happy to help 🙂
Want results from more Discord servers?
Add your server