Skip to content
Latchkey

Docker "failed to solve: no active session" (BuildKit) in CI

buildx opens a session with buildkitd to stream the build context, secrets, SSH, and registry auth. If that session is gone when the solve needs it - a dropped connection, a recycled builder, or a daemon that restarted - BuildKit fails with no active session. It is usually a transient session/connection failure, not a Dockerfile bug.

What this error means

A docker buildx build fails with failed to solve: no active session for <session-id>. A re-run on a fresh builder typically succeeds.

docker
ERROR: failed to solve: no active session for 9f3c2a1b-7d4e-4c2a-a1b2-c3d4e5f60718

Common causes

The buildx session dropped before the solve

A connection blip between buildx and buildkitd loses the session that carries context and secrets.

The builder was recycled mid-build

An ephemeral builder torn down during the job kills the active session.

A stale or misconfigured builder

A buildx builder pointed at a buildkitd that restarted no longer has a live session.

How to fix it

Re-run the build

  1. This error is usually transient - retry the job.
  2. If it clears on retry, treat it as a session/connection blip.
Terminal
docker buildx build -t myorg/api:1.4.2 --push .

Recreate and bootstrap the builder

  1. Remove the stale builder and create a fresh persistent one.
  2. Bootstrap it so a live session is established before the build.
Terminal
docker buildx rm ci || true
docker buildx create --name ci --driver docker-container --bootstrap --use

How to prevent it

  • Use a persistent, bootstrapped builder per job.
  • Avoid recycling the builder while a build is in flight.
  • Retry transient session failures before deeper debugging.

Frequently asked questions

What causes ""no active session""?
A connection blip between buildx and buildkitd loses the session that carries context and secrets.
How do I fix "no active session"?
Re-run the build

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card