Skip to content
Metabase - Deployment failed during the network process
charbel
OP

10 months ago

I’m experiencing an issue where my project is being automatically redeployed at regular intervals even though there are no changes in my GitHub repository.

These automatic deployments consistently crash. However, when I log in to the Railway dashboard and manually trigger a redeploy, the deployment completes successfully and the service works as expected.

To summarize:

  • No code changes are made in the GitHub repo
  • Automatic deployments still trigger regularly
  • Automatic deployments crash
  • Manual redeploys succeed without any issues

Could you please help me understand what is triggering these deployments and why they fail only when triggered automatically?

$10 Bounty

3 Replies

devshiby

23 days ago

Hey, this is a pretty common issue with Metabase on Railway.

What’s most likely happening is that Railway is automatically restarting/redeploying the service (either because of a health check failure, a crash recovery, or one of the platform’s recovery mechanisms after the recent incidents). When it does that automatically, the health check starts checking too early while Metabase is still running its database migrations / initialization, so the deploy gets marked as failed.

When you manually redeploy from the dashboard, you usually give it more time (or it hits a slightly different path), so it manages to finish initializing and pass the health check.

Quick things to check / fix:

  1. Health check settings (this is the #1 cause with Metabase)

    • Go to your Metabase service → Settings → Healthcheck
    • Make sure the path is /api/health
    • Increase the Timeout and especially the Retry window (try 5–8 minutes). Metabase can easily take 2–5+ minutes on startup when it has an existing database.
  2. Restart Policy

    • Set it to “On Failure” instead of “Always” if it’s currently set to always restart.
  3. Check if Image Auto Updates are on

    • If you’re pulling from a public Metabase image and have “As soon as ready” enabled, Railway sometimes triggers redeploys when it detects a new digest. That can cause the same automatic-fail behavior.
  4. Look at the actual failed deployment logs

    • Open one of the failed automatic deployments and check whether it’s dying during the “network” / healthcheck phase or if there’s a real application crash after the process starts.

If you can share:

  • Whether you have a health check configured (and what the path/timeout is)
  • A link to one of the failed deployments (or just the error line from the logs)

…I can narrow it down further.

In most cases just increasing the healthcheck retry window fixes the automatic vs manual difference.

Let me know what you find.


devshiby

23 days ago

Hey, I’ve seen this exact pattern a few times with Cloudflare + Railway custom domains.

The “train has not arrived at the station” page means the request is reaching Railway’s edge, but the edge doesn’t currently have an active route for that hostname. Your app itself is fine (which matches the metrics and the fact that toggling the Cloudflare proxy immediately fixes it).

When Cloudflare proxy is enabled (orange cloud), Railway sometimes loses or fails to refresh the domain → service mapping. Toggling the proxy forces Cloudflare to re-resolve and re-establish the connection, which is why it works as a temporary fix.

Things that usually solve the recurring version of this:

  1. SSL/TLS mode in Cloudflare

    Make sure it’s set to Full (not Full Strict and not Flexible). Full Strict often causes intermittent routing failures with Railway.

  2. Force a clean re-bind of the domain

    • Remove the custom domain from the Railway service
    • Wait 2–3 minutes
    • Add it back again
    • Confirm both the CNAME and the _railway-verify TXT are still correct
    • Keep the Cloudflare proxy off (grey cloud) for a few minutes while Railway verifies, then turn the proxy back on
  3. Check for stale records

    In Cloudflare, look for any leftover _acme-challenge or old CNAME/TXT records related to the domain and delete them.

  4. Proxy + multiple domains

    If you have both apex and www (or other subdomains) pointing through Cloudflare proxy, make sure each one is added as a separate custom domain in Railway and has its own correct CNAME target.

The fact that it happens around the same time on weekday mornings is interesting — it could be related to some internal Railway edge refresh or Cloudflare PoP behavior, but the practical fix is almost always the re-bind + correct SSL mode.

If you want, drop the exact CNAME target Railway is showing for torquetrader.io right now and I can double-check the setup with you.

Hope this clears it up.


2-beepdawdaw

19 days ago

There are two separate things to identify here: what triggered the deployment, and why startup failed. Railway healthchecks do not continuously monitor an already-active deployment, so they do not explain periodic redeployments by themselves. See https://docs.railway.com/deployments/healthchecks .

Please compare one failed automatic deployment with one successful manual redeploy: the displayed trigger/source, commit or image reference, and the first error in the deployment logs. Share only redacted details (no tokens, passwords or database URLs).

If the failure is specifically in the Network phase, that is where Railway runs startup healthchecks. Check the configured PORT against the port Metabase actually listens on; Railway uses PORT for the healthcheck, even when a target port is configured. Increase the timeout only if logs show the app is still initializing when the current timeout expires. https://docs.railway.com/deployments/troubleshooting/slow-deployments

The current information is insufficient to attribute this to Cloudflare or explain why manual redeploys succeed. No DNS deletion or restart-policy change is justified yet.

AI-assisted; factual claims checked against the linked Railway documentation. I have not accessed or tested your deployment.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...