ddev: ddev 1.18.1 with docker compose 2.2.0/2.2.1 doesn't start "volume already exists but was not created by Docker Compose. Use external: true to use an existing volume"
How to fix this problem
This is a result of a bug in docker-compose 2.2.0/2.2.1, which was unfortunately also released in Docker Desktop 4.3.0. There’s a workaround using docker-compose 2.2.2 in latest ddev v1.18.2
Ways to fix:
- Upgrade ddev to v1.18.2
- (macOS/Windows):
docker-compose disable-v2
- (macOS/Windows): Downgrade to Docker Desktop 4.2.0 (macOS or windows)
- Download the new working release 2.2.2 of docker-compose and put it in your $PATH
Run a Diagnostic and Paste Link Here
Diagnostic docker compose
2.2.0
Describe the bug
ddev 1.18.1 and docker compose
2.x.x (except 2.0.1) under arch linux doesn’t start: ddev start
output
ddev 1.18.1 and docker compose
2.0.1 under arch linux does start as expected: ddev start
output
Diagnostic docker compose
2.0.1
-> opens browser after run with message:
ddev is working. You will want to delete this project with "ddev delete -Oy tryddevproject-12143"
To Reproduce
Have latest ddev (1.18.1)
have docker compose 2.2.0
start a project (which has run before with docker compose
2.0.1)
Expected behavior Just a regular and clean ddev project start
Screenshots none useful so far
Version and configuration information (please complete the following information):
-
Host computer OS and Version: Arch Linux x86_64 | Host: TUXEDO Polaris 17 AMD Gen1 Standard | Kernel: 5.10.82-1-lts
-
ddev version information (use
ddev version
):
ddev version
ITEM VALUE
DDEV version v1.18.1
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:20211017_mysql_arm64
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.18.0
docker 20.10.11
docker-compose 2.2.0
mutagen 0.12.0
os linux
router drud/ddev-router:v1.18.0
web drud/ddev-webserver:v1.18.1
- config.yaml contents for the misbehaving project (the part before the comments):
name: 62.project
type: typo3
docroot: htdocs
php_version: "5.6"
webserver_type: apache-fpm
timezone: Europe/Berlin
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: ["62.project.test"]
mariadb_version: "10.3"
mysql_version: ""
use_dns_when_possible: true
web_environment: []
- Do you have any custom configuration (nginx, php, mysql) in the .ddev folder?
Yes
I have a
config.local.yaml
with:
name: 62project
host_db_port: 33064
because a dot in the project-name seems to make trouble too.
If so, have you tried without them? Yes
No difference: both config-variants run with docker compose 2.0.1; both config-variants won’t run with any docker compose
2.x.x
I tried the following docker compose
versions:
-rw-r--r-- 1 root root 7633420 28. Sep 20:21 /var/cache/pacman/pkg/docker-compose-2.0.0-1-any.pkg.tar.zst
-rw-r--r-- 1 root root 7638374 1. Okt 09:12 /var/cache/pacman/pkg/docker-compose-2.0.1-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root 7682535 3. Nov 15:22 /var/cache/pacman/pkg/docker-compose-2.1.0-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root 7689060 27. Nov 19:21 /var/cache/pacman/pkg/docker-compose-2.2.0-1-x86_64.pkg.tar.zst
only docker compose
2.0.1 does the job like expected
Additional context Thx in advance for any hint
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 34 (21 by maintainers)
Yeah, that’s the same as
docker-compose disable-v2
- thanks!The easy workaround I found was to go to the Docker Desktop preferences, and in the General tab uncheck Use Docker Compose v2, then Apply & Restart.
@ZYZ64738 @ajoliveau or do a one line install, passing the url directly to
pacman
will confirm its signatureor whatever I like better, just use
downgrade
from AUR and select your preferred version from ALA right from the command lineUpgrading to the latest DDEV v1.18.2 worked for me. Thanks for this thread! I tend to wait months before updating my Docker since there is never a good time to run into little bugs.
This is fixed in today’s (coming) ddev v1.18.2, which embeds docker-compose 2.2.2, which doesn’t have this problem.
The issue is fixed in ddev v1.18.2, please upgrade ddev. (ddev v1.18.2 works around the docker-compose failure described here by maintaining its own private, known-good docker-compose, so the Docker Desktop docker-compose is no longer checked or used)
It’s “Don’t update from Docker Desktop 4.2.0 which has docker-compose 2.2.1” - the numbers are confusing. Other workarounds given at the top.
Also, ddev v1.18.2 will be released today that hopefully gets us out of all this for a long time.
No, this is a bug in docker-compose, an unexpected regression from how docker-compose has worked for years. I’m sure it will be cleared up. In the meantime please use one of the many working versions of docker-compose.
I’ve opened
to bundle a working docker-compose with ddev (have it download the working version when needed). Hopefully that will let us have more a more reliable situation in the future. docker-compose v2 has had a rough go.
Opened https://github.com/docker/compose/issues/8976
You should check with the maintainers of the docker-compose package in Arch Linux and ask why prereleases are being deployed.