docker
networking
ai_generated
true
endpoint with name already exists in network
ID: docker/docker-network-endpoint-exists
90%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 27 | active | — | — | — |
Root Cause
A container with the same name is already connected to the target network. This often happens after a container crash or forced removal that left a stale network endpoint.
genericWorkarounds
-
92% success Disconnect the stale endpoint from the network first
docker network disconnect -f <network> <container-name> && docker network connect <network> <container-name>
Sources: https://docs.docker.com/reference/cli/docker/network/disconnect/
-
88% success Remove the dead container and restart with docker compose up
docker rm -f <container-name> && docker compose up -d — Compose will recreate the container with a fresh network endpoint
Sources: https://docs.docker.com/compose/
Dead Ends
Common approaches that don't work:
-
Deleting and recreating the entire Docker network
70% fail
All other containers on that network lose connectivity and must be reconnected
-
Renaming the container to avoid the conflict
75% fail
The stale endpoint still occupies the network slot; the old endpoint must be cleaned up
Error Chain
Preceded by:
Frequently confused with: