7 days ago
Hi Railway team,
Existing GitHub-deployed service. Root railway.toml sets:
healthcheckPath = "/api/health", healthcheckTimeout = 30, restartPolicyType = "on_failure"
(builder = "dockerfile" with a root Dockerfile, which we understand is auto-detected.)
In Service Settings these fields show "set in /railway.toml" and cannot be edited.
Following the guidance to copy every value into the service settings before removing the file:
- While railway.toml exists, is there any way to save these same values into the service settings (e.g. via Staged Changes or the API) so the first deploy after removal already uses them?
- If not: does the lock clear when a commit removing railway.toml is pushed (even if that push is skipped by Watch Paths), or only after a deployment built from a commit without the file?
- Once unlocked, if we set the values and commit with Alt+Deploy (no redeploy), will the next deployment use them?
Our goal is that no production deployment ever runs without the healthcheck. Thank you.
3 Replies
7 days ago
Yes. The railway.toml file overrides the service's own settings at deploy time, and while it exists you can still save the same values on the service itself with the public API serviceInstanceUpdate mutation, which accepts healthcheckPath, healthcheckTimeout and restartPolicyType. If you set those to /api/health, 30 and ON_FAILURE first, the service settings already hold the healthcheck when you remove the file, so the first deploy without the file doesn't depend on any dashboard edit after the lock clears.
Because the values are saved before the file is removed, it doesn't matter exactly when the dashboard lock clears, and you don't need the Alt+Deploy step. We haven't confirmed whether a push skipped by Watch Paths clears the lock, so the API route before removal is the safer path.
Also note that config-as-code files are deprecated. Existing files keep working until 2026-12-01, and after that we stop reading them without failing deploys. Any setting that exists only in the file stops applying at that point, so copying these values onto the service now also covers that cutoff.
Status changed to Awaiting User Response Railway • 7 days ago
Railway
Yes. The `railway.toml` file overrides the service's own settings at deploy time, and while it exists you can still save the same values on the service itself with the public API `serviceInstanceUpdate` mutation, which accepts `healthcheckPath`, `healthcheckTimeout` and `restartPolicyType`. If you set those to `/api/health`, `30` and `ON_FAILURE` first, the service settings already hold the healthcheck when you remove the file, so the first deploy without the file doesn't depend on any dashboard edit after the lock clears. Because the values are saved before the file is removed, it doesn't matter exactly when the dashboard lock clears, and you don't need the Alt+Deploy step. We haven't confirmed whether a push skipped by Watch Paths clears the lock, so the API route before removal is the safer path. Also note that config-as-code files are deprecated. Existing files keep working until 2026-12-01, and after that we stop reading them without failing deploys. Any setting that exists only in the file stops applying at that point, so copying these values onto the service now also covers that cutoff.
6 days ago
Thanks for the reply. Could a Railway team member please confirm before we touch production? Two things we observed:
- Our production service still shows "The value is set in /railway.toml" on Builder, Healthcheck Path, Healthcheck Timeout and Restart Policy. The Railway Config File path field is empty (default root file).
- On a brand-new test service using the identical railway.toml, the file was ignored entirely (empty healthcheck, no healthcheck run), which matches "services that have never used Config as Code cannot opt in."
Questions:
- While the file still exists, will a value written with serviceInstanceUpdate (healthcheckPath, healthcheckTimeout, restartPolicyType) be stored on the service itself and survive after the file is removed? Reading it back can't tell us, because the toml holds the same values.
- Does serviceInstanceUpdate trigger a redeploy? Our service has a volume, so we want to plan for the brief downtime.
- If we use
railway config migrate cutover: since our Config File path is already empty, will the root railway.toml stop being read after cutover, or do we also need to delete the file?
Our goal is that no production deploy ever runs without the healthcheck. Thank you.
Status changed to Awaiting Railway Response Railway • 6 days ago
6 days ago
Yes, a value written with serviceInstanceUpdate is saved on the service itself. The railway.toml file only overrides those service settings at deploy time, so once the file is no longer read, the healthcheckPath, healthcheckTimeout and restartPolicyType you saved apply. Your test-service result fits this: services that never used Config as Code no longer read the file at all.
On whether serviceInstanceUpdate starts a redeploy by itself, we were not able to verify that for this answer, so plan for a short volume restart window.
We don't have a railway config migrate cutover command. The documented commands are railway config migrate, --apply, and --apply --delete-files. --apply clears the Railway Config File setting, but your field is already empty and the service is reading the default root file. That means the file has to come out of the repo, either with --delete-files or by deleting it in a commit. If you go the CLI route, migrate every service in the environment together. A single-service migrate creates a named partial, and that blocks whole-project applies later.
You don't need the CLI for your goal. Save the three values with serviceInstanceUpdate while the file still exists, then remove railway.toml. The first deploy without the file then uses the saved healthcheck. Existing files keep being read until 2026-12-01. After that date they are silently ignored and deploys don't fail.
Status changed to Awaiting User Response Railway • 6 days ago