# Error response from daemon: endpoint with name container_name already exists in network bridge

- **ID:** `docker/container-name-orphaned-network-endpoint`
- **Domain:** docker
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

A container was disconnected from a network without properly removing the endpoint, leaving a stale endpoint entry in the network's internal state.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 20.10.17 | active | — | — |
| Docker 24.0.6 | active | — | — |
| Docker 25.0.0 | active | — | — |

## Workarounds

1. **Disconnect the container from the network explicitly using 'docker network disconnect -f bridge container_name' to remove the stale endpoint.** (85% success)
   ```
   Disconnect the container from the network explicitly using 'docker network disconnect -f bridge container_name' to remove the stale endpoint.
   ```
2. **If the container no longer exists, prune stale network endpoints with 'docker network prune' which removes all unused networks and their orphaned endpoints.** (90% success)
   ```
   If the container no longer exists, prune stale network endpoints with 'docker network prune' which removes all unused networks and their orphaned endpoints.
   ```
3. **As a last resort, inspect the network with 'docker network inspect bridge' to list endpoints, then manually disconnect each stale container by its ID using 'docker network disconnect -f bridge <container_id>'.** (95% success)
   ```
   As a last resort, inspect the network with 'docker network inspect bridge' to list endpoints, then manually disconnect each stale container by its ID using 'docker network disconnect -f bridge <container_id>'.
   ```

## Dead Ends

- **** — Restarting Docker does not clean up stale endpoints in individual networks; it only resets the daemon state but persistent network data remains. (70% fail)
- **** — The 'bridge' network is a default network that cannot be removed; this command will fail with 'Error response from daemon: network bridge is a pre-defined network'. (90% fail)
- **** — The container may already be removed, but the stale endpoint persists; force removal does not clean up orphaned endpoints in the network. (60% fail)
