R
Railway7mo ago
MadLex

Experiencing 500 Errors During Deployment Switches

Hello Railway team and community, I've been encountering an issue with my Next.js application deployments. Whenever I deploy a new version via a branch trigger from GitHub, I consistently face a 500 error during the switch from the past deployment to the new one. This results in a temporary Railway error page being shown to users. I've tried implementing a health check to verify Supabase's status, but the issue persists. It seems like there's a gap in the deployment process where the new version isn't fully operational before the old version shuts down, leading to service unavailability. Could you provide insights or recommendations on how to achieve a more seamless deployment process on Railway? Specifically, I'm looking for ways to minimize downtime and ensure a smoother transition between deployments. Any advice or guidance would be greatly appreciated. Thank you! Best Regards, Àlex
17 Replies
Percy
Percy7mo ago
Project ID: N/A
MadLex
MadLex7mo ago
N/A
Brody
Brody7mo ago
would you happen to have a volume attached?
MadLex
MadLex7mo ago
Nope
Brody
Brody7mo ago
you said 500 error, did you mean 503?
MadLex
MadLex7mo ago
Oh sorry, 503 yes
Brody
Brody7mo ago
what does your health check consist of?
MadLex
MadLex7mo ago
Just a select to a table (Supabase), I don’t really need to warmup my app.
Brody
Brody7mo ago
how long is temporary? can you try increasing the overlap seconds? https://docs.railway.app/develop/variables#user-provided-configuration-variables
MadLex
MadLex7mo ago
2-5s, enough if the user is navigating within the dashboard during that time awesome, will try it tomorrow morning. Thank you so much!
Brody
Brody7mo ago
no problem!
MadLex
MadLex7mo ago
hey! did not work
Brody
Brody7mo ago
what did you set it to and how?
MadLex
MadLex7mo ago
I set it to 40s, 2x the default value Then I redeployed after env var change and then I made a change to trigger a new deployment
Brody
Brody7mo ago
ill be honest, im not sure what to tell you, ive only seen this kind of issue when the service has a volume
MadLex
MadLex7mo ago
Thanks anyways! I managed to show an ‘Under Maintenance’ component while its deploying
Brody
Brody7mo ago
that's a pretty good compromise