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.)
馃帀 a website and containers
Install ddev
Config a project
Whomp whomp whaaaa
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
Did you just update Docker Edge? We had another report of this today. I think ddev rm of everything sorted it out. But he also said something about restarting docker....
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.
I don't think so. But this was a fresh new site, fresh install of ddev. When I go back on that computer I'll give it a try.
Were you able to get this sorted? I've heard a couple of instances of it, don't know if it was a docker upgrade fail or something else.
@rfay sorry, I haven't had a chance to retry, and my iMac is booted down so I can't SSH in. I'll boot it today and see. Maybe it was a "just needed a restart"
@rfay okay, after a few days, and a Docker edge upgrade. Same error.
Starting environment for caledonia-sno-lords...
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/Clients/personal/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'
$ ddev version
router drud/ddev-router:v0.5.0
commit v0.17.0
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
$ docker version
Client:
Version: 18.05.0-ce-rc1
API version: 1.37
Go version: go1.9.5
Git commit: 33f00ce
Built: Thu Apr 26 00:58:56 2018
OS/Arch: darwin/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce-rc1
API version: 1.37 (minimum version 1.12)
Go version: go1.10.1
Git commit: 33f00ce
Built: Thu Apr 26 01:06:49 2018
OS/Arch: linux/amd64
Experimental: true
You were able to fix it with docker network rm ddev_default? AFAICT this is an ongoing docker bug, let me know if you concur. I wonder if I should make a Stack Overflow question about it. I think it's only happening on docker edge, but I've seen the "container already exists" related problem on stable, but can't figure out how to recreate it.
:(
$ docker network rm ddev_default
Error response from daemon: network ddev_default is ambiguous (2 matches found based on name)
So I ran
$ docker network ls
...
$ docker network rm 55a1003d78d9
$ docker network rm 9cf527f1a6e5
And now it's good.
What might be nice: a utility command to rebuild the network? or detect if two exist. Get hashes, delete, then build.
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 projectsdocker rm -f $(docker ps -aq)docker network rm $(docker network ls -q)I haven't heard about this happening again since docker moved on, so going to close it for now, the workaround is easy, will reopen if it crops up again.
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
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.
Someone should probably create an official docker issue for this. I just posted onto this project/thread, because it was the first google result that came up related to this error.
A casual look tells me this is probably https://github.com/moby/moby/issues/20648, also related and mentioned there, https://github.com/moby/moby/issues/18864
@Clay-Ferguson did this happen to you with ddev or with something else? I ask because nobody has reported a problem like this with ddev in more than 2 years.
I landed on this issue just from a google search, and it solved the problem for me, so I tried to post what I had learned to help others, but since I am using only docker and not ddev, I shouldn't have posted here, and I apologize. I'll be happy to delete the posts if it's just clutter at this point.
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.
Most helpful comment
So I ran
And now it's good.