Build is failing
gauthamses
PROOP

2 months ago

  • Build id - 7a994607-8b5f-4482-bccb-ce3fe2996051

I have been trying to build and deploy since yesterday. Tried multiple times and still failing. This is critical

Took 59m and then failed

Build Failed: build daemon returned an error < failed to solve: Canceled: context canceled >

Region : Singapore

Closed$20 Bounty

6 Replies

Status changed to Open Railway 2 months ago


Try disabling Metal builder.


imsushant2005
FREE

2 months ago

The build failed because the build process was interrupted before completion.

Error: failed to solve: Canceled: context canceled

This usually means the build daemon stopped processing due to one of these reasons:

  • Build timeout after running too long (your run took 59 minutes)
  • Infrastructure/resource issue in the Singapore region
  • Network interruption between the build service and daemon
  • Build process being terminated internally because of memory/CPU limits
  • Temporary platform-side instability

Since you mentioned it has been happening since yesterday across multiple retries, this is more likely an environment/platform issue rather than a one-time build error.

Recommended next steps:

  1. Check if the Singapore region has any active incidents.
  2. Retry in another region if available.
  3. Review recent code/dependency changes that may have increased build time.
  4. Escalate to support with the Build ID: 7a994607-8b5f-4482-bccb-ce3fe2996051

In short: the build did not fail because of code syntax directly—it was canceled while the container/image build was still running.


0x5b62656e5d

Try disabling Metal builder.

prochorus
PRO

2 months ago

I'm getting this issue as well.

It try this and it auto-returns to enabling "Use Meta Build Environment"


imsushant2005
FREE

2 months ago

This looks like a Railway builder/platform issue.

failed to solve: Canceled: context canceled usually means the build daemon was killed/cancelled, not that the app code failed.

A likely workaround is to disable the Metal/Meta Build Environment, but if Railway automatically turns it back on after saving, then the setting is not persisting correctly on the service/project.

Things to try:

  1. Disable Use Metal Build Environment
  2. Save changes
  3. Trigger a fresh deploy, not just retry old deploy
  4. Clear build cache if available
  5. Check whether the setting flips back before or only after deployment
  6. If it keeps re-enabling, Railway support needs to reset the builder config for the service

So the issue is probably not the Dockerfile/app code. The build is being cancelled by the builder environment, and the Metal builder setting appears stuck or forced on.


edgnkv
EMPLOYEE

2 months ago

We are migrating all users to metal builders, so disabling it is not an option.

I see that new builds are passing. In case of you still see issues with builds, please comment here.


Status changed to Awaiting User Response Railway 2 months ago


saad-1-s
FREE

2 months ago

Root Cause: The build daemon hit Railway's 60-minute build timeout, then the context was canceled mid-solve — classic Gradle/JVM or large Docker layer timeout.

Fix 1 — Add .railwayignore to slim the build context:

.git
node_modules
.gradle
build/
**/*.log

Fix 2 — If using Gradle, add to gradle.properties:

org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.caching=true

Fix 3 — If using Docker, optimize your Dockerfile:

dockerfile

# Copy dependency files first (cache layer)
COPY build.gradle.kts settings.gradle.kts ./
RUN ./gradlew dependencies --no-daemon

# Then copy source
COPY src ./src
RUN ./gradlew build --no-daemon -x test

Fix 4 — Force a clean build on Railway: Go to Dashboard → your service → Settings → Deploy → Clear Build Cache, then redeploy.

Fix 5 — Switch builder explicitly in railway.toml:

toml

[build]
builder = "dockerfile"

Recommended order:

  1. Clear build cache first
  2. Add .railwayignore
  3. Add --no-daemon to Gradle
  4. Redeploy — should complete well under 60 min

Status changed to Awaiting Railway Response Railway 2 months ago


Status changed to Closed Railway 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...