a month ago
Hello Railway Support,
I’m troubleshooting a production deployment for an existing Railway service and have isolated what appears to be a deployment configuration-resolution issue.
Service
- Project ID: "3aa0d721-51e4-4dc1-935d-1ba7274c3f57"
-
- Service: "@fortress-fund/api"
-
- Service ID: "91dd24e5-3412-4d5f-a70c-61c2abcc3423"
-
- Environment: "production"
-
- Environment ID: "7169a25d-06ee-4e90-b147-21aefdc99809"
-
- Repository: "mustardir/rentable-"
-
- Branch: "main"
-
- Current commit: "3fa6aca39ecb515931cd07856c9d77ca22fb2266"
Expected configuration
The current Railway service configuration reports:
- Builder: DOCKERFILE
-
- Dockerfile path: "apps/api/Dockerfile"
-
- Root directory: "/"
-
- Build command: "pnpm --filter @fortress-fund/api build"
-
- Start command: "pnpm --filter @fortress-fund/api start"
-
- Healthcheck: "/api/health"
-
- No staged changes
I have also explicitly re-saved the Dockerfile/build configuration and reconnected the existing service source to:
"mustardir/rentable-" → "main"
The service configuration continues to report DOCKERFILE after these operations.
Actual deployment behavior
Despite the saved configuration, Railway's deployment snapshot resolves the deployment as:
- Builder: "RAILPACK"
-
- Dockerfile path: "apps/api/Dockerfile"
-
- Failure stage: "BUILD_IMAGE"
-
- Error: "Failed to build an image. Please check the build logs for more details."
The latest affected deployment is:
"2445ea82-7d59-4ace-8bf5-e282f1906af4"
The previous affected deployment was:
"b92ce959-3cb1-4604-ad29-44df2d249ad8"
Both deployments use the same repository, branch, and commit and exhibit the same DOCKERFILE-vs-RAILPACK discrepancy.
Build logs
For both failed deployments, the Railway build-log API returns an empty build-log result.
For example, deployment:
"2445ea82-7d59-4ace-8bf5-e282f1906af4"
reports:
- Status: "FAILED"
-
- Build stage: "BUILD_IMAGE"
-
- Builder snapshot: "RAILPACK"
-
- Build logs: empty
Because no build output is exposed, there is no underlying Docker/Railpack error available for us to diagnose.
Additional verification
The repository itself passes its GitHub CI checks on the same commit "3fa6aca39ecb515931cd07856c9d77ca22fb2266", including the API build and integration-test workflow.
The repository contains:
"apps/api/Dockerfile"
and the Railway service is explicitly configured to use that Dockerfile.
We also tested a diagnostic deployment that added a Prisma-client verification step to the Dockerfile. That deployment failed at "BUILD_IMAGE" before reaching the diagnostic command, further indicating that the configured Dockerfile build is not actually being executed.
Diagnostic deployment:
"fa37d0e4-4687-4ced-973d-c3aeccdbc487"
The service was subsequently restored to "main" and the diagnostic repository change was not retained.
Request
Could you please investigate why the deployment snapshot for this service is resolving to RAILPACK when the saved service configuration explicitly reports DOCKERFILE, and why the build logs are empty for the resulting "BUILD_IMAGE" failure?
In particular, I would appreciate verification of:
- The builder actually selected for deployment "2445ea82-7d59-4ace-8bf5-e282f1906af4".
- Why the deployment snapshot differs from the service configuration.
- Whether there is stale deployment/source configuration associated with this service/environment.
- Whether the Railway deployment/build system is failing before build logs are initialized.
Please let me know if you need any additional deployment or project identifiers.
Thank you.
11 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
Set RAILWAY_DOCKERFILE_PATH=apps/api/Dockerfile in your service variables, and redeploy.
a month ago
I followed your recommendation and set RAILWAY_DOCKERFILE_PATH=apps/api/Dockerfile on the @fortress-fund/api production service, then redeployed.
New deployment: a0a4646e-7744-4c8d-81d6-bc5da12ff6f2
The deployment snapshot still resolves the builder as RAILPACK, despite the service configuration being DOCKERFILE and the variable being present. It again fails at BUILD_IMAGE, with no build logs exposed.
This appears to confirm that the deployment snapshot is not honoring either the service's Dockerfile builder configuration or RAILWAY_DOCKERFILE_PATH. Could you please investigate the deployment/source configuration resolution for this service?
a month ago
Thanks. I followed the RAILWAY_DOCKERFILE_PATH recommendation.
I set the following service variable on @fortress-fund/api in the production environment:
RAILWAY_DOCKERFILE_PATH=apps/api/DockerfileI then manually redeployed the existing service.
Result: the problem persists.
The new deployment was:
a0a4646e-7744-4c8d-81d6-bc5da12ff6f2Railway's deployment diagnosis reports:
Status: FAILED
Builder: RAILPACK
Dockerfile: apps/api/Dockerfile
Root directory: /
Failure stage: BUILD_IMAGE
Error: Failed to build an image. Please check the build logs for more details.The service configuration still reports the builder as DOCKERFILE, with:
Repository: mustardir/rentable-
Branch: main
Root: /
Dockerfile: apps/api/Dockerfile
Build command: pnpm --filter @fortress-fund/api buildThe build-log query for the deployment returned no build log entries.
This means the suggested variable did not change the builder selected in the deployment snapshot: it still resolves to RAILPACK even though the service configuration is DOCKERFILE and RAILWAY_DOCKERFILE_PATH is set.
For comparison, the immediately preceding deployment was also affected:
2445ea82-7d59-4ace-8bf5-e282f1906af4It likewise resolved to RAILPACK and failed at BUILD_IMAGE.
Could you please advise what Railway-side configuration or deployment state determines the builder shown in the deployment snapshot, and why it is resolving to RAILPACK despite the service configuration and RAILWAY_DOCKERFILE_PATH both specifying the Dockerfile?
I have not made any further repository changes or database changes. The application commit being deployed is still:
3fa6aca39ecb515931cd07856c9d77ca22fb2266At this point, the remaining blocker is understanding why the deployment snapshot is not honoring the configured Dockerfile builder.
a month ago
Have you applied the changes after adding the variable? It should auto redeploy when you apply changes, instead of you manually redeploying.
a month ago
Three different config changes — re-saving the Dockerfile settings, reconnecting the source, adding RAILWAY_DOCKERFILE_PATH — all produced identical results. That pattern is the most informative thing in your report: when nothing you change in the dashboard has any effect, something outside the dashboard is deciding.
First thing to check: railway.json or railway.toml in the repo. Look at the repo root and apps/api/. Config-as-code overrides dashboard settings without updating what the dashboard displays — which is precisely your symptom, service config reporting DOCKERFILE while the deployment snapshot resolves otherwise. In the deployment details pane, values sourced from a config file are marked with a file icon; that tells you where each setting actually came from. If such a file exists and declares a builder, or sets build.buildCommand without build.dockerfilePath, that's the whole explanation and it accounts for all three interventions failing.
Second: clear the build command. You have a Dockerfile builder and pnpm --filter @fortress-fund/api build set as the build command. Those belong to different build paths — with a Dockerfile, your RUN layers do the building and the build-command field should be empty. A service carrying both is in a mixed state, and the presence of a Railpack-era build command is a plausible reason resolution drifts toward Railpack. Same for the start command, unless your Dockerfile has no CMD.
On the empty build logs, I'd read your evidence differently. You concluded the Dockerfile isn't being executed. I think the stronger reading is that no build is executing. If Railpack were genuinely running and failing, you'd see Railpack's own output — provider detection, install phase, something before the failure. Zero log entries across four deployments means the builder died before emitting a single line. That reframes the question from "why Railpack instead of Docker" to "why does the build process fail before initialising," and the builder shown in the snapshot may simply be the default displayed when resolution never completed. Your diagnostic Dockerfile step not running is consistent with this too — it's not evidence the Dockerfile was bypassed, it's evidence nothing ran.
Monorepo detail worth confirming: with root directory /, the Docker build context is the entire repo, so apps/api/Dockerfile must address paths from the repo root — COPY pnpm-lock.yaml ./ and COPY apps/api ./apps/api, never ../../. Your GitHub CI passing on the same commit doesn't rule this out; CI almost certainly builds with -f apps/api/Dockerfile from a different working directory, so a context mismatch would pass there and fail here. If you've been developing the Dockerfile against a local docker build apps/api, that's the same mismatch.
Order: check for the config file (one look, explains everything if present), clear the build command, redeploy. If the logs are still empty after both, it's Railway-side and the deployment IDs you've already posted are what staff need.
One question that would narrow this a lot: did this service ever deploy successfully, or is this the first deploy on it? A service that used to work and then stopped points at drift — a config file added to the repo, or a builder migration. A service that has never deployed points at the Dockerfile or the context. Your report doesn't say, and the two paths diverge completely.
a month ago
The test failed again.
Exact result:
- Deployment:
6e26364d-037c-45d1-ac59-bf49ab6b373b - Status: FAILED
- Failure stage:
BUILD_IMAGE - Snapshot still reports RAILPACK
- Dockerfile still reports
apps/api/Dockerfile - Root:
/ - Generic error:
Failed to build an image - Diagnosis: none
So clearing the build command did not resolve the builder-resolution problem.
Next exact action
Do not change another Railway setting yet.
We should now check the repository itself for railway.json / railway.toml at:
/railway.json/railway.toml/apps/api/railway.json/apps/api/railway.toml
That is the next diagnostic because the dashboard is still showing Dockerfile while the deployment snapshot resolves RAILPACK.
a month ago
Latest test result:
I cleared the Railway service build command and redeployed. The deployment still failed:
- Deployment:
6e26364d-037c-45d1-ac59-bf49ab6b373b - Commit:
3fa6aca39ecb515931cd07856c9d77ca22fb2266 - Failure stage:
BUILD_IMAGE - Deployment snapshot builder:
RAILPACK - Dockerfile path:
apps/api/Dockerfile - Root directory:
/ - Build command: empty
- Start command:
pnpm --filter @fortress-fund/api start
I also checked the repository on main. There is no railway.json or railway.toml at the repo root or under apps/api/.
So the service has no Railway config-as-code file declaring the builder, and the build command is now empty, but the deployment snapshot still resolves to RAILPACK while the service configuration reports Dockerfile.
Please investigate the builder-resolution/deployment initialization for deployment 6e26364d-037c-45d1-ac59-bf49ab6b373b and provide the exact underlying diagnostic/build logs, including why RAILPACK is being selected and why the build fails at BUILD_IMAGE.
a month ago
The next thing we need from Support is why that configuration is turning into RAILPACK during deployment
mustardir
The next thing we need from Support is why that configuration is turning into RAILPACK during deployment
a month ago
That rules out my first hypothesis — no config file, build command cleared, same failure. Good. Cross it off. What's left is the build context, and that's where root / puts you.
Before anything else, on @mayori's request: I'd answer that directly — the Build Logs pane is empty, there's nothing to screenshot. That's not a gap in your report, it's the central evidence. Say so plainly so that request doesn't cost you another day.
Stop asking why the snapshot says RAILPACK. I think that's a dead end and it's absorbing all your attention. Five deployments now — b92ce959, 2445ea82, a0a4646e, fa37d0e4, 6e26364d — and not one emitted a single log line. If Railpack were genuinely running, you'd see its output: provider detection, install phase, something before the failure. Zero lines means nothing executed, and RAILPACK is most likely just the field's default value where builder resolution never completed. It's an uninitialized field, not a setting overriding your Dockerfile. Support confirming "the builder was RAILPACK" wouldn't move you forward even if they answered today.
Your fa37d0e4 diagnostic is the strongest evidence in the whole thread, and I'd read it the opposite way you did. You added a Prisma-verification step and the build failed before reaching it. You concluded the Dockerfile was bypassed. But a build with a missing or empty context fails before the first instruction too — identical symptom, completely different cause. That test doesn't distinguish them.
You already have the evidence to settle this. Your CI passes on 3fa6aca. Open the workflow that builds the API and read the actual docker build line:
If it's docker build -f apps/api/Dockerfile . from the repo root → your context matches Railway's, I'm wrong, say so and I'll drop it.
If it's docker build apps/api, or has working-directory: apps/api, or a context: that isn't . → that's your answer, and "CI passes on this commit" stops being evidence of anything. A context mismatch passes there and fails here.
That's one file, no deployment, no waiting.
Then two checks, in this order:
-
cat .dockerignore at the repo root. This is my main suspect now. If it contains apps/, packages/, or a bare * without re-includes, the context arrives essentially empty and the build dies before logging anything — your exact symptom across all five deployments. Paste it here if it exists.
-
The COPY paths in apps/api/Dockerfile. With context at the repo root they must be root-relative:
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/api ./apps/api
COPY packages ./packages # if @fortress-fund/api depends on workspace packages
Not paths written as if the Dockerfile's own directory were the context, and never ../../ — that escapes the context and errors immediately. Note pnpm-workspace.yaml specifically: without it, pnpm --filter @fortress-fund/api can't resolve the package at all.
And reproduce it locally:
docker build -f apps/api/Dockerfile .
The trailing . is the whole point — repo root as context, exactly what Railway sends. If you've been testing with docker build apps/api, that's a different context and it will pass while Railway fails. Thirty seconds, and it tells you whether this is yours or Railway's. I'd do this before changing another dashboard setting.
Two loose ends:
Your start command is still pnpm --filter @fortress-fund/api start. If your Dockerfile has a CMD, clear it. Not your build failure, but it'll bite you immediately after you fix this one.
And I'll ask a third time because it changes which path you're on and support will ask too: has this service ever deployed successfully, or is this its first deploy? First deploy → the Dockerfile or the context, which is everything above. Previously working then stopped → drift, and I'd look elsewhere. Your reports still don't say, and I can't narrow further without it.
Post the .dockerignore, the CI docker build line, and the local build output. One of those three has your answer, and none of them require Railway to respond.
darseen
Have you applied the changes after adding the variable? It should auto redeploy when you apply changes, instead of you manually redeploying. 
a month ago
Yes