Container failed to start

3 months ago

Hey Railway folks,

I’m running into a deployment issue where my service fails with:

"Container failed to start"

Context:

  • Node.js (Express) backend

  • Deployed via Nixpacks (nodejs_20)

  • Build completes successfully

  • npm start is used as the start command

  • Deployment fails immediately after build with no runtime logs

Logs show:

  • Build succeeds

  • No application logs appear

  • After some time: “Container failed to start / Failed to create deployment”

What I’ve verified:

  • App listens on process.env.PORT and binds to 0.0.0.0

  • Health check (/health) exists and returns 200

  • No nodemon / dev tools in production

  • App runs locally with npm start

  • Added global error handlers for uncaughtException / unhandledRejection

  • Using Express + Stripe (webhooks)

Suspicion:
The Node process may be exiting immediately at startup (possibly due to top-level imports or env-dependent code like Stripe initialization), before the server stays alive.

Question:
Is there a recommended way on Railway to:

  • Debug silent container exits at startup?

  • Surface startup-time crashes more explicitly?

  • Or confirm whether npm start is executing the expected entry file?

Happy to share snippets or repo details if needed.
Thanks

19 Replies

yorizel
HOBBY

3 months ago

+1 same thing here


sup-rith
PRO

3 months ago

Hey can we get any help here?


essaubaid
FREE

3 months ago

Hey @Mohit Sapat,

I'm encountering the same issue, I believe it's some problem with the deployment because I have branches that are already deployed also failing to deploy


wheelern
PRO

2 months ago

This is happening to me as well. I thought it was due to config changes I made, but I reverted to a previously working commit and even that commit is no longer deploying. It builds without problem and then "deploys" for ~26 minutes, then fails. Has happened repeatedly for the past 17 hours.


wheelern
PRO

2 months ago

Curious if everyone's services are on Railway metal? Mine is, and here's a thread of someone who briefly had the same issue after a service was pinned to metal: https://discord.com/channels/713503345364697088/1453775315754160128


2 months ago

Just following up in case a Railway team can take a look

Multiple users here (including me) are seeing the same pattern:

  • Build succeeds

  • No runtime logs

  • Deployment hangs ~20–30 min

  • Fails with “Container failed to start”

  • Reverting to previously working commits does not help

There seems to be a strong correlation with services pinned to Railway Metal.
This started recently and appears unrelated to app code.

Could you please confirm if there’s an ongoing issue or recent change affecting Metal deployments?
Happy to share repro details if needed.


wheelern
PRO

2 months ago

FWIW, unchecking "Use Metal Build Environment" and redeploying doesn't fix it.


dayflareroblox
FREE

2 months ago

im having this issue, with railpack it hangs on "image push"


dayflareroblox
FREE

2 months ago

after unticking metal and testing with nixpacks it hangs on "Build time: 77.47 seconds"


wheelern
PRO

2 months ago

I fixed this by deleting the service and re-adding it.


essaubaid
FREE

2 months ago

Tried duplicating the service, didn't work for me. This seems like an issue with people on the hobby plan; I don't see anyone on the pro plan facing this issue.


joshua-wise
HOBBY

2 months ago

Having the same issue, I tried unchecking metal and deploying a previous successful build. No luck. Haven't tried deleting the service yet.


2 months ago

For anyone experiencing an issue, please open your own help thread and, if possible, include steps to reproduce the problem.

Most of the time these errors occur because your application crashes too early without generating any logs.


essaubaid
FREE

2 months ago

@ThallesComH All of us have already mentioned that our services had been running and deploying fine prior to us encountering this issue. In fact, most people have also mentioned the fact that we have tried deploying branches that had previously successfully deployed, and even those branches are failing to deploy. None of us has visibility into what is causing this failure. According to the logs, there are no errors while building the image; it only gets stuck while trying to upload the image.


joshua-wise
HOBBY

2 months ago

@ThallesComH I've opened a separate thread as requested, no response at the moment, issue is persistent.


wheelern
PRO

2 months ago

I’m on pro.


wheelern
PRO

2 months ago

Duplicating the service or even the entire stack to a new environment didn’t work. Had to delete the problematic service and re-add it.


yanayzabary
HOBBY

2 months ago

Same issue here. Something got broken. Seems to point to the automatic involuntary upgrade to metal edge


joshua-wise
HOBBY

2 months ago

Deleted and recreated service, up and running now. Agreed that it's metal upgrade related.


Loading...