3 months ago
Bytecode compiled 598 files in 337ms
INFO: Started server process [139]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://[::]:8080 (Press CTRL+C to quitgoing to the url just shows a 502 on the http logs, and it doesn't even show up on the deploy logs.
5 Replies
3 months ago
yo, your app is actually starting fine but its listening on the wrong interface/port so railway cant connect to it → thats why u get 502
to fix this:
go to your service → settings → custom start command and change it to:
uvicorn main:app --host 0.0.0.0 --port $PORT(only change main:app if ur app instance has a different name like app:app or src.main:app or whatever. just use whatever u run locally)
save it and redeploy
let me know if that fixes it.
bytekeim
yo, your app is actually starting fine but its listening on the wrong interface/port so railway cant connect to it → thats why u get 502to fix this:go to your service → settings → custom start command and change it to:uvicorn main:app --host 0.0.0.0 --port $PORT(only change main:app if ur app instance has a different name like app:app or src.main:app or whatever. just use whatever u run locally)save it and redeploylet me know if that fixes it.
3 months ago
thanks, but now my internal url doesn't seem to work?
Network error in generate_poster: Cannot connect to host image-api.railway.internal:8080 ssl:default [Connect call failed ('fd12:36a9:70a9:0:2000:14:afb0:b42b', 8080, 0, 0)]
Attachments
thanks, but now my internal url doesn't seem to work?Network error in generate_poster: Cannot connect to host image-api.railway.internal:8080 ssl:default [Connect call failed ('fd12:36a9:70a9:0:2000:14:afb0:b42b', 8080, 0, 0)]
3 months ago
Hey, please check if your service is listening on port 8080. It should be the same port that Railway is using, which should be printing to your console. Also, check if your service can connect to services over IPv6.
bytekeim
yo, your app is actually starting fine but its listening on the wrong interface/port so railway cant connect to it → thats why u get 502to fix this:go to your service → settings → custom start command and change it to:uvicorn main:app --host 0.0.0.0 --port $PORT(only change main:app if ur app instance has a different name like app:app or src.main:app or whatever. just use whatever u run locally)save it and redeploylet me know if that fixes it.
3 months ago
3 months ago
hi just bumping this if anyone has a solution