“Deployment failed during network process” “Network → Healthcheck failure”
melestorcal-web
HOBBYOP

2 months ago

Hello Railway team,

I'm experiencing a problem deploying an n8n service in my project. The deployment fails during the network phase with the following error:

“Deployment failed during network process”
“Network → Healthcheck failure”

According to the logs, the build and initialization processes complete successfully, but the service fails the healthcheck, causing the deployment to fail. The error occurs specifically after the “Deploy” stage, during the service availability check.

I'm currently using Docker to deploy n8n, and the service is connected to Redis and Postgres instances within the same Railway environment, which appear to be functioning correctly.

I suspect the problem might be related to:

The port n8n is listening on (possible conflict with the PORT variable required by Railway)

The host configuration (possibly n8n is bound to localhost instead of 0.0.0.0)

Or the timing/configuration of the healthcheck

Could you help me verify what might be causing the healthcheck to fail, or if there are any specific configuration requirements for services like n8n in Railway?

Thank you in advance for your help.
$10 Bounty

3 Replies

Status changed to Open Railway about 2 months ago


Make sure your n8n service is listening on the PORT env variable provided by Railway to your container.

You can read more about this here: https://docs.railway.com/deployments/healthchecks#configure-the-healthcheck-port


reypepino69
FREE

2 months ago

  1. Update Environment Variables in your n8n service (Railway Dashboard → Service → Variables):
    • Add or ensure: * PORT=5678 (critical – tells Railway exactly which port to health-check and route traffic to). * N8N_PORT=5678 (explicitly matches the default; reinforces the binding). * N8N_LISTEN_ADDRESS=0.0.0.0 (ensures binding to all interfaces; the default :: is usually fine but this eliminates any IPv4/IPv6 edge cases).
    • (Optional but recommended for production) Add your existing DB/Redis variables (e.g., DB_TYPE=postgresdb, connection strings using Railway’s internal references like postgres.railway.internal, QUEUE_BULL_REDIS_HOST, etc.) and WEBHOOK_URL pointing to your Railway-generated domain.
  2. Configure the Health Check (Railway Dashboard → Service → Settings → Health Check / Networking section):
    • Set Health Check Path to /healthz.
    • (If the /healthz endpoint is not responding) Add the variable N8N_METRICS=true to your service; this enables the health-check endpoint in recent n8n versions.
    • You may also increase the Retry Window or Timeout if n8n’s startup (including DB/Redis initialization) takes slightly longer than the default.
  3. Redeploy the service (or trigger a new deployment). The build and initialization should succeed as before, but the network-phase health check should now pass.


reypepino69
FREE

2 months ago

Alternative Quick Workaround (If You Prefer Not to Change Health-Check Settings)

In the same service Settings page, simply remove/disable the health check entirely. Many n8n users on Railway do this successfully because the container itself is stable once initialized. This is safe for non-critical services but removes zero-downtime deployment guarantees.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...