R
Railway2y ago
Krøn

Django 503 after deploy (build successful)

Whenever i deploy my Django app and build is successful occasionally if i try to access it i get a 503 for a couple of minutes before it finally shows, does anyone know what's the issue?
15 Replies
Percy
Percy2y ago
Project ID: 04e32fbc-e27a-4a31-9438-73fd306d26a9
Percy
Percy2y ago
⚠️ experimental feature
Krøn
Krøn2y ago
04e32fbc-e27a-4a31-9438-73fd306d26a9
Brody
Brody2y ago
have your app listen on host 0.0.0.0 and environmental variable PORT gunicorn will do this automatically
Adam
Adam2y ago
The deploy may take a second, the build succeeding just means the environment is ready
Brody
Brody2y ago
its odd since it's usually 404 until the routes can propagate through the proxy
Krøn
Krøn2y ago
It does 0.0.0.0:8000 Oh okay, so random question, before it can successfully deploy assuming I’m in a production environment, every operation done during that period will return an error. Should I shut down my app while I’m deploying to avoid this issue or is there a workaround?
Adam
Adam2y ago
there’s a Railway env variable that sets the time between a new deploy being active and the last deployment being removed can’t remember off the top of my head, but you can set that to a large number
Krøn
Krøn2y ago
Oh great where is it
Adam
Adam2y ago
in the docs somewhere likely, can’t find it atm I’m out
Krøn
Krøn2y ago
Okay no worries thank you, I’ll look for it It’s very helpful
Brody
Brody2y ago
there's also the health check that in my experience greatly increases the speed railway will switch to the new deployment
Adam
Adam2y ago
In this case they'd want to increase that time, not reduce it They could set up a healthcheck that does the opposite. Waiting until everything is 100% up and running before swapping
Brody
Brody2y ago
yeah health check cause railway to switch over only when everything okay, so no 503 while migrations or whatever are being run
Krøn
Krøn2y ago
Oh okay Thank you everyone
Want results from more Discord servers?
Add your server