ddev: 2 matches found based on name: network ddev_default is ambiguous

What happened (or feature request):

When running updates for a small legacy site, I decided to use ddev! But when I ran ddev start after ddev config I saw

$ ddev start
Starting environment for caledonia-sno-lords...
ddev needs to add an entry to your hostfile.
It will require administrative privileges via the sudo command, so you may be required
to enter your password for sudo. ddev is about to issue the command:
    sudo /usr/local/bin/ddev hostname caledonia-sno-lords.ddev.local 127.0.0.1
Please enter your password if prompted.
Running Command  Command=sudo /usr/local/bin/ddev hostname caledonia-sno-lords.ddev.local 127.0.0.1
Password:
2 matches found based on name: network ddev_default is ambiguous
Failed to start caledonia-sno-lords: Failed to run docker-compose [-f /Users/mglaman/caledonia-sno-lords/.ddev/docker-compose.yaml up -d], err='exit status 1', stdout='', stderr='2 matches found based on name: network ddev_default is ambiguous'

I had just installed ddev on my iMac via the instructions (so super fresh.)

What you expected to happen:

🎉 a website and containers

How to reproduce this:

Install ddev Config a project Whomp whomp whaaaa

Version: Please include the output of ddev version, docker version and the project’s .ddev/config.yaml.

$ ddev version
domain  ddev.local
cli     v0.17.0
web     drud/nginx-php-fpm-local:v1.2.2
db      drud/mariadb-local:v0.9.0
dba     drud/phpmyadmin:v0.2.0
router  drud/ddev-router:v0.5.0
commit  v0.17.0
$ docker version
Client:
 Version:       18.04.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    3d479c0
 Built: Tue Apr 10 18:13:16 2018
 OS/Arch:       darwin/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.04.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   3d479c0
  Built:        Tue Apr 10 18:23:05 2018
  OS/Arch:      linux/amd64
  Experimental: true
$ cat .ddev/config.yaml
APIVersion: "1"
name: caledonia-sno-lords
type: drupal7
docroot: ""
php_version: "7.1"
webimage: drud/nginx-php-fpm-local:v1.2.2
dbimage: drud/mariadb-local:v0.9.0
dbaimage: drud/phpmyadmin:v0.2.0
router_http_port: "80"
router_https_port: "443"
additional_hostnames: []
provider: default

Anything else do we need to know:

Related source links or issues:

Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (17 by maintainers)

Most upvoted comments

So I ran

$ docker network ls
...
$ docker network rm 55a1003d78d9
$ docker network rm 9cf527f1a6e5

And now it’s good.

Regardless, I think you just need a docker network rm, but would be interested to hear the details, whether you updated docker, whether you’re on edge, etc.

It looks like docker network prune might be an answer also. https://github.com/docksal/docksal/issues/1236#issuecomment-642804569

I do see plenty of reports of this but haven’t found my way to a docker issue.

I think: docker network ls docker network rm <hash> <hash>

I think this approach would work in general for people who are using only ddev with docker:

  • ddev rm all projects
  • docker rm -f $(docker ps -aq)
  • docker network rm $(docker network ls -q)

No, it’s fine. I was just trying to learn if it was an experience in ddev or not, and you’ve answered that. We’ll leave this closed.

I saw this happen when I accidentally ran my shell script that starts docker compose twice simultaneously, by accidentally clicking a desktop icon in Ubuntu 20.04 twice.

So it looks like this is likely caused by some kind of concurrency bug where there needs to be maybe a mutex (thread locking mechanism, like what Java would call ‘synchronized block’) in the docker, around the logic in docker where it checks for a network before creating the network. Or that is, docker should make sure when it creates a network, no other thread can exist that is also creating a network.

By the way the solution by rfay above worked for me also:

docker network ls
docker network rm <hash> <hash>

My docker version in case it helps: 19.03.8, build afacb8b7f0

What might be nice: a utility command to rebuild the network? or detect if two exist. Get hashes, delete, then build.