2 months ago
I tried to deploy changes to my service (factorum), they pass initialization, build, deploy, and then on Network > Healthcheck, I get a Healtcheck failure.
Attempt #1 failed with service unavailable. Continuing to retry for 1m58s
Attempt #2 failed with service unavailable. Continuing to retry for 1m57s
Attempt #3 failed with service unavailable. Continuing to retry for 1m55s
Attempt #4 failed with service unavailable. Continuing to retry for 1m51s
Attempt #5 failed with service unavailable. Continuing to retry for 1m43s
Attempt #6 failed with service unavailable. Continuing to retry for 1m27s
Attempt #7 failed with service unavailable. Continuing to retry for 57s
Attempt #8 failed with service unavailable. Continuing to retry for 27s
1/1 replicas never became healthy!
Healthcheck failed!
Deploy logs are all fine, the only thing is the last log is COMMIT, and it never logs the usual "Application startup complete" (duh, it failed healtcheck). Otherwise all good.
It feels like Railway issue, since I didn't even make any groundbreaking changes that would crash the app.
Pinned Solution
2 months ago
Are you listening on the PORT env variable provided by Railway to your container?
If your application doesn't listen on the PORT variable, possibly due to using target ports, you can manually set a PORT variable to inform Railway of the port to use for health checks.
Not listening on the PORT variable or omitting it when using target ports can result in your health check returning a service unavailable error.
You can read more about this here: https://docs.railway.com/deployments/healthchecks#configure-the-healthcheck-port
1 Replies
Status changed to Open Railway • 2 months ago
2 months ago
Are you listening on the PORT env variable provided by Railway to your container?
If your application doesn't listen on the PORT variable, possibly due to using target ports, you can manually set a PORT variable to inform Railway of the port to use for health checks.
Not listening on the PORT variable or omitting it when using target ports can result in your health check returning a service unavailable error.
You can read more about this here: https://docs.railway.com/deployments/healthchecks#configure-the-healthcheck-port
Status changed to Solved brody • 2 months ago
