Skip to content
Latchkey

Docker "failed to create endpoint on network" in CI

The daemon could not attach a container to a network. failed to create endpoint <name> on network <net> usually means a leftover endpoint/veth from a crashed container, an exhausted address pool, or a stale name still bound on the network.

What this error means

A docker run / docker network connect fails with Error response from daemon: failed to create endpoint <name> on network <net>: .... The network exists but the new endpoint cannot be created.

docker
docker: Error response from daemon: failed to create endpoint quizzical_api on network bridge:
endpoint with name quizzical_api already exists in network bridge.

Common causes

A leftover endpoint from a crashed container

A container that died uncleanly can leave its endpoint/veth registered, so re-creating one with the same name collides.

The network address pool is exhausted

A bridge/network with too many attached endpoints (or a small subnet) can run out of addresses for a new endpoint.

Stale network state on the runner

Accumulated networks/endpoints from prior jobs leave the daemon network state inconsistent.

How to fix it

Disconnect the stale endpoint and prune networks

Force-remove the leftover container/endpoint and clean unused networks.

Terminal
docker network disconnect -f bridge quizzical_api || true
docker rm -f quizzical_api || true
docker network prune -f

Recreate the network or use a fresh one

Remove and recreate a wedged network, or run on a clean per-job network.

Terminal
docker network rm myapp_net || true
docker network create myapp_net

How to prevent it

  • Clean up containers and networks between jobs on persistent runners.
  • Use unique, per-job network/container names.
  • Size custom network subnets for the number of endpoints you attach.

Frequently asked questions

What causes ""failed to create endpoint""?
A container that died uncleanly can leave its endpoint/veth registered, so re-creating one with the same name collides.
How do I fix "failed to create endpoint"?
Force-remove the leftover container/endpoint and clean unused networks.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

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