ddev: Project start fails after update to 1.18.0 with custom Dockerfile
Diagnostic: https://gist.github.com/pminf/42da8afc08a62ddf8461a112c0e8fe57
Describe the bug After updating to 1.18.0 I’m unable to start any of my existing projects. They all fail with
Failed to start foo: container failed to become healthy: err=container /ddev-foo is unhealthy: phpstatus: FAILED /var/www/html: OK mailhog: FAILED
There seems to be a problem with apache:
[pid 1946] (13)Permission denied: AH00023: Couldn't create the mpm-accept mutex (file /var/lock/apache2/mpm-accept-0.1946)
(13)Permission denied: could not create accept mutex
If I’m switching the webserver-type from apache-fpm to nginx-fpm it’s starting without problems.
To Reproduce I’m able to reproduce it in a clean quickstart project (steps: https://ddev.readthedocs.io/en/stable/users/cli-usage/#php-project-quickstart) plus a custom Dockerfile (attached). The Dockerfile seems to make the difference because without it ddev does start without failure.
Expected behavior Just start within seconds as usual.
Version and configuration information
- Host computer OS and Version: Microsoft Windows 10 Pro (Version 10.0.19043 Build 19043) with WSL2 and Ubuntu 20.04
- Docker Desktop version: 4.0.1
- ddev version information:
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.8
docker-compose 1.29.2
mutagen 0.12.0-beta7
os linux
router drud/ddev-router:v1.18.0
web drud/ddev-webserver:v1.18.0
- config.yaml contents for the misbehaving project (the part before the comments):
name: foo
type: php
docroot: web
php_version: "7.4"
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: "1"
- Do you have any custom configuration (nginx, php, mysql) in the .ddev folder? If so, have you tried without them? Dockerfile (it’s working fine without it):
# You can copy this Dockerfile.example to Dockerfile to add configuration
# or packages or anything else to your webimage
ARG BASE_IMAGE=drud/ddev-webserver
FROM $BASE_IMAGE
RUN apt-get update
# basics
RUN apt-get install -y openssl curl dirmngr gnupg2
# basics
RUN apt-get install -y \
openssl \
curl \
dirmngr \
gnupg2 \
locales \
python3-pip
# install RVM, Ruby, and Bundler
# https://stackoverflow.com/questions/61787926/how-can-i-get-sass-compass-into-the-ddev-web-container
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests build-essential ruby-full rubygems
RUN gem install compass
# Install frontend development tools
RUN npm install grunt grunt-cli \
&& npm install -g \
grunt \
grunt-cli \
gulp
# German locales
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& echo 'LANG="de_DE.UTF-8"' > /etc/default/locale \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=de_DE.UTF-8
ENV LANG de_DE.UTF-8
# Install Python modules
RUN apt-get install -y \
python3-pip
RUN pip3 install paramiko
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (12 by maintainers)
All good here, we “fixed” it by adding
echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
😃Here’s a working, simplified and updated Dockerfile. It works for me on amd64 Linux, but not on M1 arm64.
Using this, the /var/lock/apache2 isn’t disrupted by whatever was happening.
Note that paramiko does not claim to run on python3 though, http://www.paramiko.org/ - and python2 has been removed from Debian 11 Bullseye.
Glad you’re doing OK with it. The way I was getting in there was
<ctrl>-c
right after the container was started andddev ssh
right then. We could also have turned off the healthcheck.BTW, you’ll want to change your “basics” line to use the recommended
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests
And the first “basics” line is completely redundant - you do all those again with the second one.
The problem is that something you’ve installed has changed the ownership of /var/lock/apache2 to www-data.
The easiest workaround is probably to add to your Dockerfile
chmod 777 /var/lock/apache2
. That’s not completely correct but probably doesn’t matter for this situation.Thanks for chasing this. Looks like we’ll have to add something to your Dockerfile.
With a normal apache-fpm, I see this
Yours will obviously have your own user.
Apparently something about your setup is changing that?
You can likely
ddev ssh
even though it’s not becoming healthy and poke around.