a month ago
I have a front service and a back service deployed on railway, everything is working well, and suddenly, my front is getting 502 on options request without any change, and I dont see any spike related to resources.
and I think a fe seconds after a redeploy or a restart (or maybe its just a coincidence, it starts working again)
5 Replies
a month ago
If your application takes a long time to start (connecting to a DB etc.) Railway might be routing traffic to it before it is actually ready to accept connections. You need to configure a Health Check Path in your service settings (/health). Railway will not route traffic (avoiding 502s) until that endpoint returns a 200 OK.
a month ago
The thing is, my application was already started and was successfully returning responses, then suddenly it started returning 502, and there was no event during this transition (I didn't touch to anything, and cpu memory limits were not at all reached)
a month ago
Can you check if your application crashed during the time you started getting 502 errors? Providing error logs will be helpful as well.
a month ago
a month ago
Well, since the logs don't show any errors during that time, I don't really know what could be causing this. Maybe your app was OOM Killed, but you said there was no spike in memory usage, so it's not likely the case.