Skip to content
Container failed to start

a year 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

Closed

19 Replies

yorizel

a year ago

+1 same thing here


sup-rith

a year ago

Hey can we get any help here?


essaubaid

a year 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

a year 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

a year 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


a year 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

a year ago

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


dayflareroblox

a year ago

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


dayflareroblox

a year ago

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


wheelern

a year ago

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


essaubaid

a year 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

a year ago

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


a year 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

a year 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

a year ago

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


wheelern

a year ago

I’m on pro.


wheelern

a year 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

a year ago

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


joshua-wise

a year ago

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...