ddev: Cant start ddev : Service 'web' failed to build (corrupted docker on linux/btrfs)

I’m facing a error at ddev start and cant start the ddev machine - Drupal 9 project.

Without succes, I’ve tried different version of docker-compose and I’ve tried to clean everything with ddev poweroff && docker rm -f $(docker ps -a -q) && docker rmi $(docker images --filter "dangling=true" -q --no-trunc) && docker rmi -f $(docker images -q) && docker volume rm ddev-ssh-agent_dot_ssh ddev-ssh-agent_socket_dir

Error at ddev start


     Service 'web' failed to build : The command '/bin/sh -c (groupadd --gid $gid "$username" ||
     groupadd "$username" ||
     true) && (useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" ||
     useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' "$username" ||
     useradd  -l -m -s "/bin/bash" --gid "$gid" --comment '' "$username")' returned a non-zero code: 9

Console screenshot


OS: Linux Mint 20.2 (BTRFS)

Docker version 20.10.9, build c2ea9bc

docker-compose version 1.29.2, build 5becea4

Composer version 2.1.9 2021-10-05 09:47:38

ddev version v1.18.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (13 by maintainers)

Most upvoted comments

docker-compose 2.1.1 seems to work OK from my testing.

Oh, I see @rfay already posted on this issue and opened this one.

So:

  • It is official: Docker Compose 2.1.0 breaks DDEV, please do not use it.
  • However, one user has just reported 2.1.1 does work.
  • @OCTOGONE-DEV and @arturu might have been affected by a different bug.

I have had the same problem. In my case the “drud/ddev-ssh-agent” image was not being built. It took me 2 days to get back up and running 😦 My problem occurred after doing distribution updates (not ddev) and reboot.

At first the errors I saw was the following:

Failed to start arturu5: failed to start ddev-ssh-agent: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-arturu5 docker-compose -f /home/arturu/.ddev/.ssh-auth-compose-full.yaml -p ddev-ssh-agent up --build --force-recreate -d', action='[-p ddev-ssh-agent up --build --force-recreate -d]', err='exit status 1', stdout='Sending build context to Docker daemon     259B
Step 1/6 : ARG BASE_IMAGE
Step 2/6 : FROM $BASE_IMAGE
', stderr='1 error occurred:
	* Status: pull access denied for 1000, repository does not exist or may require 'docker login': denied: requested access to the resource is denied, Code: 1

and

Status: pull access denied for 1000, repository does not exist or may require 'docker login': denied: requested access to the resource is denied, Code: 1

I removed all images and containers and the errors appeared:

The command '/bin/sh -c (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd  -l -m -s "/bin/bash" --gid "$username" --comment '' "$username" || useradd  -l -m -s "/bin/bash" --gid "$gid" --comment '' "$username")' returned a non-zero code: 6, Code: 6

and groupadd: invalid group ID 'drud/ddev-ssh-agent:v1.18.0'

Finally I was able to find this thread and this reply was very useful to me, however, I made several attempts to find the right solution for my case.

I exported all the databases with a mariadb docker image (10.3 the same version used by ddev)

# docker run --name salvami -v <project-name>-mariadb:/var/lib/mysql -e MARIADB_ROOT_PASSWORD=<pass> -d mariadb:10.3

# docker exec -it salvami /bin/bash

~# cd /var/lib/mysql

~# mysqldump ... etc etc
~# exit

# cp /var/lib/docker/volumes/<project-name>-mariadb/_data/db-dump.sql ...
  • ddev poweroff
  • docker system prune -a
  • docker rm -f $(docker ps -a -q)
  • docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
  • docker rmi -f $(docker images -q)
  • remove all volumes
  • uninstall ddev and docker-compose
  • uninstall docker-ce and related package
  • sudo rm -rf /var/lib/docker
  • sudo rm -rf /etc/docker
  • removed .ddev and .docker folder in /home/<username>
  • reboot (<— important!!! )
  • re-installing everything (docker-compose from apt repository)
  • ddev start in ddev machine folder
  • ddev import-db

I solved it thanks to this tread, thanks.

OS POP_OS 21.04 last update Composer 2.0.9 2021-01-27 16:09:27 DDEV

  • version v1.18.0
  • architecture amd64
  • db drud/ddev-dbserver-mariadb-10.3:v1.18.0
  • dba phpmyadmin:5
  • ddev-ssh-agent drud/ddev-ssh-agent:v1.18.0
  • docker 20.10.10
  • docker-compose 1.25.0
  • mutagen 0.12.0-beta7
  • os Linux arturu 5.13.0-7620-generic # 20~1634827117~21.04~874b071-Ubuntu SMP Fri Oct 29 15:06:55 UTC x86_64 x86_64 x86_64 GNU/Linux
  • router drud/ddev-router:v1.18.0
  • web drud/ddev-webserver:v1.18.0

NOTE: I don’t use btrfs.

…, and 1.25.0 for @arturu (BTW is this still valid after you reinstalled the package?).

@felmab yes, after a clean install everything works with docker-compose 1.25, but I had to install docker-compose from the ubuntu repository (installing from homebrew didn’t work).

# apt info docker-compose
Package: docker-compose
Version: 1.25.0-1
...
Section: universe/admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Docker Compose Team <team+docker-compose@tracker.debian.org>
...
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages

However, one user has just reported 2.1.1 does work.

Maybe, the upgrade doesn’t work? From a clean installation, everything is fine.