Dagger "failed to connect to engine" in CI
The Dagger CLI provisions and connects to a Dagger Engine container, which needs a Docker daemon or a compatible runtime. If Docker is absent or the engine cannot start, the CLI cannot connect and the run aborts before any pipeline runs.
What this error means
dagger fails with "failed to connect to engine" or "Cannot connect to the Docker daemon" before your functions run.
Error: failed to connect to engine: failed to start engine: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?Common causes
No Docker daemon in the job
Dagger runs its engine as a container. A CI job with no Docker daemon has no runtime to start the engine.
The engine container could not start
Missing privileges or a blocked image pull prevents the engine container from coming up, so the CLI has nothing to connect to.
How to fix it
Provide Docker for the engine
- Use a runner with Docker, or add a docker:dind service.
- Confirm
docker infoworks before invoking dagger. - Let the CLI provision the engine once Docker is reachable.
- run: docker info
- run: dagger call buildPoint at an existing engine
If you run the engine as a service, set the runner variable so the CLI connects to it instead of provisioning one.
export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://dagger-engineHow to prevent it
- Run Dagger on a runner with a working Docker daemon.
- Verify
docker infobefore invoking dagger. - Reuse a provided engine service for faster startup.