Dagger "context canceled" in CI
"context canceled" means the operation's context was cut off before it finished. In CI this is rarely a code bug: the job timed out, the engine was OOM-killed, or the CLI lost its connection to the engine mid-run.
What this error means
dagger fails with "context canceled" or "rpc error: code = Canceled" partway through a pipeline, often after a long-running step.
Error: input: container.withExec.sync: context canceled
rpc error: code = Canceled desc = context canceledCommon causes
The CI job timed out
A job or step timeout cancels the context, aborting whatever the engine was doing at that moment.
The engine was OOM-killed or dropped
If the engine container is OOM-killed or the connection drops, in-flight operations are canceled.
How to fix it
Rule out timeouts and resources
- Check whether the job or step hit its timeout.
- Give the engine more memory so it is not OOM-killed.
- Read the engine logs to confirm it stayed up through the run.
docker logs dagger-engineRaise timeouts for long pipelines
Increase the job timeout so a long build has time to finish before the context is canceled.
jobs:
build:
timeout-minutes: 45How to prevent it
- Set job timeouts that fit the longest pipeline.
- Give the engine enough memory to avoid OOM cancels.
- Keep the engine connection stable on long runs.