23 days 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
6 Replies
Status changed to Open Railway • 23 days ago
22 days 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:
- Check if the Singapore region has any active incidents.
- Retry in another region if available.
- Review recent code/dependency changes that may have increased build time.
- 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.
22 days ago
I'm getting this issue as well.
It try this and it auto-returns to enabling "Use Meta Build Environment"
22 days 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:
- Disable Use Metal Build Environment
- Save changes
- Trigger a fresh deploy, not just retry old deploy
- Clear build cache if available
- Check whether the setting flips back before or only after deployment
- 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.
22 days 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 • 22 days ago
22 days 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/
**/*.logFix 2 — If using Gradle, add to gradle.properties:
org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.caching=trueFix 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 testFix 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:
- Clear build cache first
- Add
.railwayignore - Add
--no-daemonto Gradle - Redeploy — should complete well under 60 min
Status changed to Awaiting Railway Response Railway • 22 days ago
Status changed to Closed Railway • 22 days ago