a month ago
Service: api.vergecrm.com (backend, builds from /backend subfolder of a monorepo)
Our backend has failed to build 5 times across 2 days (Oct 7 and Oct 9), with no code changes to the backend itself between the last successful build and the first failure. Production has stayed up throughout thanks to our healthcheck gate, but we've been fully blocked from deploying backend changes for 2 days.
Two distinct failure patterns, across these deployments:
-
c2952771 (Oct 7, 14:03) - Failed. Builder: railpack-v0.40.1. Build stopped ~10s into the "prepare" step with no useful log output. Diagnosis: "Infrastructure Error," unable to pinpoint a cause, noted the same commit/config had built successfully ~16 minutes earlier.
-
fea2b7ad (Oct 7, 14:16) - Redeployed the same commit. Failed identically. Same diagnosis, same inability to pinpoint a cause.
-
62b999e6 (Oct 9, 16:27) - Redeployed again after 2 days. Failed identically. Same diagnosis.
-
4bc04af6 (Oct 9, 16:33) - After adding a RAILPACK_PYTHON_VERSION=3.13 env var to test a theory. This run switched builders entirely, to Nixpacks (matching our railway.toml's builder = "NIXPACKS" setting, which the three Railpack runs above did NOT honor). Failed differently:
pip install uv==$NIXPACKS_UV_VERSIONresolved $NIXPACKS_UV_VERSION to empty, producing an invalid requirement (uv==) and exit code 1. -
8dac45c0 (Oct 9, 16:44) - Removed the RAILPACK_PYTHON_VERSION variable to isolate whether it caused the builder switch, and redeployed. Still ran on Nixpacks (ruling out that variable as the cause of the switch), and failed with the exact same uv== / empty NIXPACKS_UV_VERSION error. This run's diagnosis also noted "the commit only changed frontend files while this service builds from the backend directory" — we're aware our service currently rebuilds on every push regardless of what changed, and are addressing that separately, but wanted to flag it since your own tooling surfaced it.
Questions:
-
Why did builder selection switch between Railpack and Nixpacks across these attempts without any explicit change on our end (other than the one variable we've now ruled out)?
-
Why is $NIXPACKS_UV_VERSION resolving to empty rather than falling back to a sensible default?
-
Is there a known issue affecting Railpack's "prepare" step around Oct 7–9 that would explain the first 3 failures?
I am happy to provide additional logs or details; my hope is to have reliable backend deploys again.
Thanks for your time.
2 Replies
a month ago
The Railpack failure on Oct 9 at 16:27 was not an infrastructure problem: its build log shows Railpack detected Python with uv, then stopped in the prepare step with "No start command detected", which is what made prepare exit with an error. Setting the start command in the service's settings is the preferred way to give Railpack one. The Nixpacks runs did pick up a start command (uv run alembic upgrade head && uv run uvicorn ...), which suggests your railway.toml was read on those runs but not on the Railpack ones.
On builder selection, the service's saved build setting currently reads Railpack with a root directory of backend. The Railway config file does not follow the root directory, so for a monorepo it has to be referenced by its absolute path, for example /backend/railway.toml, as described in the monorepo guide. The deployment record does not show why the later Oct 9 runs resolved to Nixpacks while earlier ones used Railpack.
On the uv error, NIXPACKS_UV_VERSION is not among the variables set on this service (only three are defined), so the Nixpacks install command expanded it to nothing and pip rejected uv==.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
Update: found the actual root cause, confirmed with a clean A/B test.
Following your note about the Config File Path needing to be the absolute path for a monorepo, I set it to /backend/railway.toml and also removed our builder = "NIXPACKS" override (per the Railpack docs) so this service uses Railpack as configured in its saved settings.
That fixed the build immediately, but on a later redeploy of the identical commit, it failed again with the same "No start command detected" error. Checking the Config-as-code settings panel, the Config File Path field showed empty, despite having been set and saved earlier in the same session.
I then ran a controlled test:
- Redeployed without touching anything which failed (field still shows empty)
- Redeployed again, unchanged which failed identically (confirms it's not transient)
- Re-entered /backend/railway.toml in the field, saved, redeployed which succeeded
So the Config File Path setting for this service is not persisting reliably as it appears to silently revert to empty between sessions/deploys, and has to be re-applied before each deploy to get a working build. This matches the deprecation banner now showing on that settings page ("Config as Code is deprecated, existing config files keep working until 2026-12-01") which is possibly related to that transition, but wanted to flag the specific reproducible pattern in case it's useful.
As a workaround, I've set the start command directly via the dashboard's Custom Start Command field instead of relying on the config file for that setting, and that has resolved the deploy failures since which was confirmed with a successful deploy after setting it.
One thing worth flagging though: this only covers the start command. healthcheckPath, healthcheckTimeout, and restartPolicyType are still defined in railway.toml and still depend on that same Config File Path field. If it reverts to empty again, I'd expect those to silently fall back to Railway's defaults rather than cause a loud build failure this time which is a quieter version of the same underlying issue, not something we've actually fixed at the root. We're planning to migrate off Config as Code to Infrastructure as Code before the December cutover regardless, but wanted to flag that the field itself still appears unreliable even though today's specific symptom is gone.
Thanks again for your help getting to the bottom of this!
Status changed to Awaiting Railway Response Railway • about 1 month ago
Status changed to Solved Railway • about 1 month ago