PHP-Apache Service Hangs after Upgrade to Docker Desktop v4.15.0

  • Issue type: Problems after Upgrading Docker Desktop
  • OS Version/build: Windows 11 Home 22H2 build 22621.963.
  • App version: Docker Desktop 4.15.0
  • Further environment details: I shelled into the WSL2 Ubuntu 22.04 to do all my dev work so even though I’m running a Windows Docker Desktop, my dev environment is really Linux.

For the past 8 months I have been running a local dev environment with 3 containers (Apache, MySQL and Redis) orchestrated by a docker-compose.yaml file. I had done multiple Docker-Desktop upgrades with no issues until version 4.15.0.

What happens is when I log into the web app, it always stops at a critical point after logging in. I suspect it’s at the point the web-app is reaching out to an external server on the Internet. The page goes white, browser status line shows “waiting for localhost” and it stays there without timing out forever (until I force the container to shut down.)

I have done a lot of experimenting e.g.

  1. have chmod -R 777 on the root folder of the web app to ensure no restrictions
  2. fiddled around with various entries for “user” in the docker-compose.yaml (contents captured below, the latest entry there being an attempt to force root user)
  3. disabled anti-virus

None worked and I have been stuck for 5 days. Today I decided to use Telerik Fiddler to check the web app’s network activity. A very strange thing was discovered. Whenever I start running Fiddler in the background before logging in (and keep Fiddler running), everything works perfectly as it was before the 4.15.0 upgrade. If however I log into the app before opening Fiddler, it again gets stuck.

So I can only conclude the upgrade has made some changes to how the networking works and for some reason, when Fiddler is running, it enables the containerized web app’s external access.

From some searches, I came across “com.docker.diagnose.exe check”, result of which seems to indicate a problem reaching the host but since I had never run it before, I do not know if it’s specific to 4.15.0. Results are also pasted below.

My questions:

  1. How can I get to the root and fix this issue?
  2. Is there a safer way to go about upgrades? I can just imagine this happens in production.
  3. Is there a way to downgrade to lower versions of Docker Desktop (especially on Windows) without affecting my data? I expect removing and re-installing docker should not affect them since all ephemeral items are persisted in bind mounts in my compose.yaml.

I would appreciate all the help I can get here.

Contents of docker-compose.yaml:

version: "3.3"
services:
  mysql:
    container_name: mysql57
    image: mysql:5.7.37
    command: --default-authentication-plugin=mysql_native_password
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: .....
      MYSQL_DATABASE: ....
      MYSQL_USER: ....
      MYSQL_PASSWORD: .....
    volumes:
      - ./dbdata:/var/lib/mysql
      - ./mysql/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
    ports:
      - 3307:3306
  apache:
    depends_on:
      - mysql
      - redis
    build:
      context: ./php
      dockerfile: Dockerfile
    user: "0:0"
    container_name: php73
    restart: unless-stopped
    volumes:
      - ./html/:/var/www/html/
    ports:
      - 91:80
  redis:
    image: 'redis:alpine'
    ports:
      - '${FORWARD_REDIS_PORT:-6379}:6379'
    volumes:
      - './redis:/data'
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      retries: 3
      timeout: 5s

Contents of Dockerfile:

FROM php:7.3.33-apache
RUN apt-get update && apt-get upgrade -y \
    && apt-get install -y \
    libmagickwand-dev \
    libxml2 \
    libxml2-dev \
    libxslt-dev \
    zlib1g-dev \
    libzip-dev \
    libpng-dev \
    unzip
RUN pecl install redis \
    && docker-php-ext-enable redis
RUN pecl install imagick \
    && docker-php-ext-enable imagick
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install- 
php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions gd intl ldap
COPY ./php.ini /usr/local/etc/php/
COPY ./ioncube_loader_lin_7.3.so /usr/local/lib/php/extensions/no-debug-non-zts-20180731/
RUN docker-php-ext-install xsl
RUN docker-php-ext-install zip
RUN docker-php-ext-install gd
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install json
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install soap
RUN apt-get update -y && apt-get install -y libjpeg62-turbo-dev libpng-dev
RUN docker-php-ext-configure gd \
    --with-jpeg-dir \
    --with-png-dir
EXPOSE 80

Result of com.docker.diagnose.exe check:

[2022-12-22T20:32:25.491799300Z][com.docker.diagnose.exe][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0002: does the bootloader have virtualization enabled?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized? 
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0006: is the Docker Desktop Service responding?
[FAIL] DD0012: is the VM networking working? network checks failed: failed to ping host: exit status 1
[2022-12-22T20:32:34.929059600Z][com.docker.diagnose.exe][I] ipc.NewClient: b52d8fcf- 
  diagnose-network -> \\.\pipe\dockerDiagnosticd diagnosticsd
 [common/pkg/diagkit/gather/diagnose.runIsVMNetworkingOK()
[       common/pkg/diagkit/gather/diagnose/network.go:34 +0xd9
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0x1b44340)
[       common/pkg/diagkit/gather/diagnose/test.go:46 +0x43
[common/pkg/diagkit/gather/diagnose.Run.func1(0x1b44340)
[ common/pkg/diagkit/gather/diagnose/run.go:17 +0x5a
[common/pkg/diagkit/gather/diagnose.walkOnce.func1(0x2?, 0x1b44340)
[       common/pkg/diagkit/gather/diagnose/run.go:142 +0x77
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x1, 0x1b44340, 0xc0003db728)
[       common/pkg/diagkit/gather/diagnose/run.go:151 +0x87
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x0, 0x1b44940, 0xc0003db728)
[       common/pkg/diagkit/gather/diagnose/run.go:148 +0x52
[common/pkg/diagkit/gather/diagnose.walkOnce(0x14e2c80?, 0xc00035f890)
[       common/pkg/diagkit/gather/diagnose/run.go:137 +0xcc
[common/pkg/diagkit/gather/diagnose.Run(0x1b44940, 0x19b7490000000000?, {0xc00035fb20, 0x1, 0x1})
[       common/pkg/diagkit/gather/diagnose/run.go:16 +0x1d4
[main.checkCmd({0xc00007e3d0?, 0xc00007e3d0?, 0x4?}, {0x0, 0x0})
[       common/cmd/com.docker.diagnose/main.go:133 +0x105
[main.main()
[       common/cmd/com.docker.diagnose/main.go:99 +0x287
[2022-12-22T20:32:34.931451900Z][com.docker.diagnose.exe][I] (657638a7) b52d8fcf-diagnose-network C->S diagnosticsd POST /check-network-connectivity: {"ips": 
["192.168.153.1","192.168.116.1","192.168.1.55","172.23.208.1"]}
[2022-12-22T20:32:35.474637400Z][com.docker.diagnose.exe][W] (657638a7) b52d8fcf-diagnose-network C<-S 38bab53c-diagnosticsd POST /check-network-connectivity (543.7229ms): failed to ping host: exit status 1

[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[WARN] DD0032: do Docker networks overlap with host IPs? network blue_sail has subnet     172.23.0.0/16 which overlaps with host IP 172.23.208.1

Please note the following 1 warning:

1 : The check: do Docker networks overlap with host IPs?
Produced the following warning: network blue_sail has subnet 172.23.0.0/16 which overlaps with host IP 172.23.208.1

If the subnet used by a Docker network overlaps with an IP used by the host, then containers
won't be able to contact the overlapping IP addresses.

Try configuring the IP address range used by networks: in your docker-compose.yml.
See https://docs.docker.com/compose/compose-file/compose-file-v2/#ipv4_address-ipv6_address


Please investigate the following 1 issue:

1 : The test: is the VM networking working?
Failed with: network checks failed: failed to ping host: exit status 1

VM seems to have a network connectivity issue. Check your host firewall and anti-virus settings in case they are blocking the VM.