docker-compose fails with 'no such network' after compose v2 upgrade; existing overlay network collisions on Ubuntu 22.04
Environment
Ubuntu 22.04 host running Docker Engine 24.0, several docker-compose (compose v2) project stacks and a pre-existing Docker Swarm overlay network named proj_default created earlier by a legacy script.
Symptoms
docker compose up for one project fails with: "ERROR: network proj_default declared as external, but could not be found" or "no such network: proj_default". Other unrelated containers keep running.
Observations
docker network ls shows two networks with the same human-readable name but different IDs and drivers (bridge vs overlay). docker daemon logs show repeated errors about creating endpoints and network driver 'overlay' refusing attach. docker-compose v2 CLI appears to be creating a local named network that collides with the external overlay.
Already attempted
Tried 'docker compose down' and 'docker compose up --remove-orphans', removed the named network with 'docker network rm' (one instance), restarted Docker, changed COMPOSE_PROJECT_NAME and project directory, tried 'docker network create --driver bridge proj_default' then re-run compose.
Question
What caused the network name collision after upgrade and how can I safely restore compose stacks without impacting Swarm overlay networks or other running services?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Virtualization26% match
Docker Swarm overlay network: intermittent inter-node packet loss when two overlay networks share the same subnet/VNI
Open0 answers - Linux25% match
Ubuntu 22.04: Docker containers intermittently lose DNS after host switches to systemd-resolved stub resolver during network changes
Solved1 answer - Networking23% match
Docker overlay network experiences severe packet loss and retransmits after NIC firmware update — large VXLAN packets fragmented by offload regression
Open0 answers - Servers23% match
After a kernel upgrade Docker containers get 'permission denied' writing to bind-mounted volumes (overlay2/overlayfs change)
Open0 answers - Virtualization22% match
Docker Swarm overlay: intermittent packet loss between nodes after lowering MTU — vxlan fragmented frames dropped
Open0 answers