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
Project ID:
04e32fbc-e27a-4a31-9438-73fd306d26a9
You might find these helpful:
- 503 error when accessing domain
- Django Website Deploy 403 error
- Django Build taking hours
⚠️ experimental feature
04e32fbc-e27a-4a31-9438-73fd306d26a9
have your app listen on host 0.0.0.0 and environmental variable PORT
gunicorn will do this automatically
The deploy may take a second, the build succeeding just means the environment is ready
its odd since it's usually 404 until the routes can propagate through the proxy
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?
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
Oh great where is it
in the docs somewhere likely, can’t find it atm I’m out
Okay no worries thank you, I’ll look for it
It’s very helpful
there's also the health check that in my experience greatly increases the speed railway will switch to the new deployment
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
yeah health check cause railway to switch over only when everything okay, so no 503 while migrations or whatever are being run
Oh okay
Thank you everyone