a month ago
My service bot-15m-hl-perp has a reproducible deployment issue tied to Use Metal Build Environment.
Working merged config:
- no buildEnvironment = "V3"
Broken merged config:
- buildEnvironment = "V3"
If I disable Use Metal Build Environment in the UI and click deploy, Railway turns it back on and the merged config again contains buildEnvironment = "V3".
When that happens, the service deploys on the newer Metal/V3 builder path and my runtime process no longer receives required env vars (ENV_VAR_1, ENV_VAR_2), causing startup failure.
/bots/railway.toml is being read correctly and does not contain buildEnvironment = "V3".
This looks like Railway is forcibly re-applying Metal/V3 despite the toggle being disabled.
Working env had NixPack 1.38x and Node v22. Broken one uses Nixpack 1.41 and Node v24.
Build log shows warnings for "SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data" which seem to be red herring (as per some other threads I have seen here)
It seems the env vars are being passed to my service. The deploy logs fail over and over with this error
[bot-15m-hl] {"ts":"2026-04-22T13:50:07.053Z","level":"FATAL","bot":"STAI-15M-HL","msg":"<ENV_VAR_1> and <ENV_VAR_2>must be set","stack":"Error: ENV_VAR_1 and ENV_VAR_2must be set\n at new HlRest (/app/shared/hl_rest.js:287:13)\n at main (/app/bot_15m_hl.js:871:23)\n at Object. (/app/bot_15m_hl.js:2353:3)\n at Module._compile (node:internal/modules/cjs/loader:1760:14)\n at Object..js (node:internal/modules/cjs/loader:1893:10)\n at Module.load (node:internal/modules/cjs/loader:1480:32)\n at Module._load (node:internal/modules/cjs/loader:1299:12)\n at TracingChannel.traceSync (node:diagnostics_channel:328:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)\n at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)"}
Also for the record, both ENV vars are set correctly on the service, so that is not the issue.
3 Replies
Status changed to Open Railway • about 1 month ago
a month ago
As an FYI, this was working today morning, and started failing about an hour ago. So this forced rollout of Metal, NixPacks and New node version have happened recently. I tried overriding the setting by supplying my toml, but it gets overridden during build/deploy time by Railway nevertheless..
a month ago
Hmm. Not ideal really. I do like how beta products get rolled out without enough testing or warning and customers are asked to deal with it https://status.railway.com/incident/XINDW2RF
a month ago
I have since then deleted and created a new service and it seems to pick up by toml which overrides the build env to "not v3".
Status changed to Solved tranceporter • 29 days ago