4 months ago
I have an endpoint at /healthz, yet every time I deploy I get a 502 Bad Gateway until the deploy is complete. I thought it was supposed to spin up a new instance, wait for /healthz to return a 200 OK and then route traffic to the new instance. Doesn't seem to work.
5 Replies
4 months ago
How you're describing it is the way it should work... I'll spin up a demo and see if I can replicate what you're seeing.
4 months ago
Made a super simple Bun server that will return 200s on /healthcheck after it's been running for 20 seconds and confirmed that the old deployment continued to be served until /healthcheck on the new deployment returned and it started to serve the new version.
What kind of tech stack or application are you running? Is (I'm assuming) the 502 Bad Gateway error coming from your Railway service, or is it coming from Cloudflare or any other middleman proxy?
proudparrot2
Made a super simple Bun server that will return 200s on /healthcheck after it's been running for 20 seconds and confirmed that the old deployment continued to be served until /healthcheck on the new deployment returned and it started to serve the new version.What kind of tech stack or application are you running? Is (I'm assuming) the 502 Bad Gateway error coming from your Railway service, or is it coming from Cloudflare or any other middleman proxy?
4 months ago
Thanks for checking. On railway, I have a simple .NET web app deployed. We are using Cloudflare as a reverse proxy in front of railway, but that should be fine. I'll have to do some more testing I guess.
proudparrot2
Made a super simple Bun server that will return 200s on /healthcheck after it's been running for 20 seconds and confirmed that the old deployment continued to be served until /healthcheck on the new deployment returned and it started to serve the new version.What kind of tech stack or application are you running? Is (I'm assuming) the 502 Bad Gateway error coming from your Railway service, or is it coming from Cloudflare or any other middleman proxy?
3 months ago
Got a response from railway team: There is a known caveat when you have a volume attached, two deployments cannot be attached to the same volume at the same time, so we do need to shut the old deployment down before starting the new deployment, thus temporarily bringing your service offline instead of overlapping the deployments. https://docs.railway.com/reference/volumes#caveats