Repository: ddev/ddev

Issue #4809: WSL2: Ports randomly in use after Windows update KB5025239 (2023-04)
Created: 2023-04-12T08:45:16Z
Is there an existing issue for this?

 I have searched the existing issues

Run a Diagnostic and Paste Link Here
Tested on ddev 1.21.4 and 1.21.6.

    ddev debug test output
ddev debug test
Running bash [-c /tmp/test_ddev.sh] 
======= Existing project config =========
These config files were loaded for project feelgood-shop-shopware-6.x: [/home/pnies/XXXXXXXXXXXXX-shop-shopware-6.x/.ddev/config.yaml]
name: XXXXXXXXXXXXX-shop-shopware-6.x
type: shopware6
docroot: public
php_version: 8.0
webserver_type: nginx-fpm
webimage: drud/ddev-webserver:v1.21.4
router_http_port: 80
router_https_port: 443
additional_hostnames: []
additional_fqdns: []
database: {mariadb 10.4}
host_db_port: 3307
mailhog_port: 8025
mailhog_https_port: 8026
phpmyadmin_port: 8036
phpmyadmin_https_port: 8037
project_tld: ddev.site
use_dns_when_possible: true
composer_version: 2
nodejs_version: 16
default_container_timeout: 120
web_extra_exposed_ports: [{administration-watch 8080 8081 8080} {storefront-watch 9998 8083 9998}]
======= Creating dummy project named  tryddevproject-16796 in ../tryddevproject-16796 =========
OS Information: Linux WS 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
User information: uid=1000(pnies) gid=1000(pnies) groups=1000(pnies),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(netdev),1001(docker)
DDEV version:  ITEM             VALUE                                   
 DDEV version     v1.21.4
 architecture     amd64
 db               drud/ddev-dbserver-mariadb-10.4:v1.21.4
 dba              phpmyadmin:5
 ddev-ssh-agent   drud/ddev-ssh-agent:v1.21.4
 docker           20.10.23
 docker-compose   v2.14.0
 docker-platform  docker-desktop
 mutagen          0.16.0
 os               linux
 router           drud/ddev-router:v1.21.4
 web              drud/ddev-webserver:v1.21.4
PROXY settings: HTTP_PROXY='' HTTPS_PROXY='' http_proxy='' NO_PROXY=''
======= DDEV global info =========
Global configuration:
instrumentation-opt-in=true
omit-containers=[]
mutagen-enabled=false
nfs-mount-enabled=false
router-bind-all-interfaces=false
internet-detection-timeout-ms=3000
disable-http2=false
use-letsencrypt=false
letsencrypt-email=
table-style=default
simple-formatting=false
auto-restart-containers=false
use-hardened-images=false
fail-on-hook-fail=false
required-docker-compose-version=
use-docker-compose-from-path=false
project-tld=
xdebug-ide-location=
no-bind-mounts=false
use-traefik=false

======= DOCKER info =========
docker location: lrwxrwxrwx 1 root root 48 Apr 12 10:23 /usr/bin/docker -> /mnt/wsl/docker-desktop/cli-tools/usr/bin/docker
docker version:
Client: Docker Engine - Community
 Cloud integration: v1.0.31
 Version:           20.10.23
 API version:       1.41
 Go version:        go1.18.10
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
DOCKER_DEFAULT_PLATFORM=notset
======= Mutagen Info =========
======= Docker Info =========
Docker platform: docker-desktop
Using docker context: default (unix:///var/run/docker.sock)
docker-compose: v2.14.0
Using DOCKER_HOST=unix:///var/run/docker.sock
Docker version: 20.10.23
Able to run simple container that mounts a volume. 
Able to use internet inside container. 
Docker disk space:
Filesystem                Size      Used Available Use% Mounted on
overlay                 250.9G    230.3G      7.8G  97% /

unable to create project at project root '/home/pnies/XXXXXXXXXXXXX-ai/shopware': project root /home/pnies/XXXXXXXXXXXXX-ai/shopware does not exist
unable to create project at project root '/home/pnies/m2-sources': project root /home/pnies/m2-sources does not exist
Container ddev-XXXXXXXXXXXXX-shop-shopware-6.x-db  Removed
Container ddev-XXXXXXXXXXXXX-shop-shopware-6.x-dba  Removed
Container ddev-XXXXXXXXXXXXX-shop-shopware-6.x-web  Removed
Network ddev-XXXXXXXXXXXXX-shop-shopware-6x_default  Removed
Project XXXXXXXXXXXXX-shop-shopware-6.x has been stopped.
Container ddev-XXXXXXXXXXXXX-db  Removed
Container ddev-XXXXXXXXXXXXX-dba  Removed
Container ddev-XXXXXXXXXXXXX-web  Removed
Network ddev-XXXXXXXXXXXXX_default  Removed
Project XXXXXXXXXXXXX has been stopped.
Container ddev-XXXXXXXXXXXXX-shopware-6.x-db  Removed
Container ddev-XXXXXXXXXXXXX-shopware-6.x-dba  Removed
Container ddev-XXXXXXXXXXXXX-shopware-6.x-web  Removed
Network ddev-XXXXXXXXXXXXX-shopware-6x_default  Removed
Project XXXXXXXXXXXXX-shopware-6.x has been stopped.
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
Existing docker containers: 
CONTAINER ID   IMAGE                                                            COMMAND                  CREATED        STATUS                      PORTS                                NAMES
14a9165f6d3b   1991236e5a0a                                                     "/bin/sh"                10 days ago    Created                                                          phpstorm_helpers_PS-223.8836.42
d904efa173c0   drud/ddev-webserver:v1.21.4                                      "sh -c 'chown -R 100…"   11 days ago    Exited (0) 11 days ago                                           brave_yalow
1cd3791bcf50   drud/ddev-webserver:v1.21.4                                      "sh -c 'df / | awk '…"   5 weeks ago    Exited (0) 5 weeks ago                                           nostalgic_lumiere
e7263dfb27b6   3e776de1c357                                                     "/bin/sh"                7 weeks ago    Created                                                          phpstorm_helpers_PS-223.8617.59
2a141e68efaa   196546e12edb                                                     "/bin/sh"                2 months ago   Created                                                          phpstorm_helpers_PS-223.8214.64
89afb4658b3d   redis:3                                                          "docker-entrypoint.s…"   3 months ago   Exited (255) 3 months ago   6379/tcp                             XXXXXXXXXXXXX-board-redis-1
f3c8403f8236   mysql:5.7                                                        "docker-entrypoint.s…"   3 months ago   Exited (255) 3 months ago   33060/tcp, 0.0.0.0:33002->3306/tcp   XXXXXXXXXXXXX-board-mysql-1
e2df3934cf78   node:14.17                                                       "docker-entrypoint.s…"   3 months ago   Exited (255) 3 months ago                                        XXXXXXXXXXXXX-board-node-1
Creating a new ddev project config in the current directory (/home/pnies/tryddevproject-16796) 
Once completed, your configuration will be written to /home/pnies/tryddevproject-16796/.ddev/config.yaml

Configuring unrecognized codebase as project type 'php' at /home/pnies/tryddevproject-16796/web
Configuration complete. You may now run 'ddev start'. 
Network ddev_default created 
Starting tryddevproject-16796...
Container ddev-ssh-agent  Started 
ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys. 
Network ddev-tryddevproject-16796_default  Created 
Container ddev-tryddevproject-16796-dba  Started 
Container ddev-tryddevproject-16796-web  Started 
Container ddev-tryddevproject-16796-db  Started
Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:443 -> 0.0.0.0:0: listen tcp 127.0.0.1:443: bind: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.
Failed to start tryddevproject-16796: failed to start ddev-router: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-tryddevproject-16796 docker-compose -f /home/pnies/.ddev/.router-compose-full.yaml -p ddev-router up -d', action='[-p ddev-router up -d]', err='exit status 1', stdout='', stderr='Container ddev-router  Creating
Container ddev-router  Created
Container ddev-router  Starting
Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:443 -> 0.0.0.0:0: listen tcp 127.0.0.1:443: bind: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.'
unable to create project at project root '/home/pnies/XXXXXXXXXXXXX-sources': project root /home/pnies/XXXXXXXXXXXXX-sources does not exist
unable to create project at project root '/home/pnies/XXXXXXXXXXXXX-ai/shopware': project root /home/pnies/XXXXXXXXXXXXX-ai/shopware does not exist
┌────────────────────────────┬───────────────────────────┬──────────────────────────────┬────────────────────────────────────────┬───────────┐
│ NAME                       │ STATUS                    │ LOCATION                     │ URL                                    │ TYPE      │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ XXXXXXXXXXXXX-board              │ stopped                   │ ~/XXXXXXXXXXXXX-board              │                                        │ laravel   │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ ddev-magento2              │ stopped                   │ ~/ddev-magento2              │                                        │ magento2  │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ XXXXXXXXXXXXX-shop-shopware-6.x │ stopped                   │ ~/XXXXXXXXXXXXX-shop-shopware-6.x │                                        │ shopware6 │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ XXXXXXXXXXXXX-shopware-6.x      │ stopped                   │ ~/XXXXXXXXXXXXX-shopware-6.x      │                                        │ shopware6 │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ XXXXXXXXXXXXX             │ stopped                   │ ~/XXXXXXXXXXXXX             │                                        │ laravel   │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ XXXXXXXXXXXXX-shopware-6.x           │ stopped                   │ ~/XXXXXXXXXXXXX-shopware-6.x           │                                        │ shopware6 │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ shopware-6.x               │ stopped                   │ ~/shopware-6.x               │                                        │ shopware6 │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ stage                      │ stopped                   │ ~/XXXXXXXXXXXXX/stage             │                                        │ shopware6 │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ tryddevproject-16796       │ OK                        │ ~/tryddevproject-16796       │ https://tryddevproject-16796.ddev.site │ php       │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ tryddevproject-4680        │ .ddev/config.yaml missing │ ~/tryddevproject-4680        │                                        │ php       │
├────────────────────────────┼───────────────────────────┼──────────────────────────────┼────────────────────────────────────────┼───────────┤
│ Router                     │                           │ ~/.ddev                      │                                        │ original: │
│                            │                           │                              │                                        │  v1.21.4  │
└────────────────────────────┴───────────────────────────┴──────────────────────────────┴────────────────────────────────────────┴───────────┘

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Project: tryddevproject-16796 ~/tryddevproject-16796 https://tryddevproject-16796.ddev.site                                           │
│ Docker provider: docker 20.10.23                                                                                                      │
│ Router: traditional                                                                                                                   │
├────────────┬──────┬──────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────┤
│ SERVICE    │ STAT │ URL/PORT                                                                                     │ INFO               │
├────────────┼──────┼──────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ web        │ OK   │ https://tryddevproject-16796.ddev.site                                                       │ php PHP8.0         │
│            │      │ InDocker: web:8025,443,80                                                                    │ nginx-fpm          │
│            │      │ Host: 127.0.0.1:53173,53172                                                                  │ docroot:'web'      │
│            │      │                                                                                              │ NodeJS:16          │
├────────────┼──────┼──────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ db         │ OK   │ InDocker: db:3306                                                                            │ mariadb:10.4       │
│            │      │ Host: 127.0.0.1:53174                                                                        │ User/Pass: 'db/db' │
│            │      │                                                                                              │ or 'root/root'     │
├────────────┼──────┼──────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ PHPMyAdmin │ OK   │ https://tryddevproject-16796.ddev.site:8037                                                  │                    │
│            │      │ InDocker: dba:80,80                                                                          │                    │
│            │      │ `ddev launch -p`                                                                             │                    │
├────────────┼──────┼──────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ Mailhog    │      │ MailHog: https://tryddevproject-16796.ddev.site:8026                                         │                    │
│            │      │ `ddev launch -m`                                                                             │                    │
├────────────┼──────┼──────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ All URLs   │      │ https://tryddevproject-16796.ddev.site, https://127.0.0.1:53172,                             │                    │
│            │      │ http://tryddevproject-16796.ddev.site, http://127.0.0.1:53173                                │                    │
└────────────┴──────┴──────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┘

============= ddev-tryddevproject-16796-web healtcheck run =========
+ for f in /etc/bashrc/*.bashrc
+ source /etc/bashrc/commandline-addons.bashrc
++ export 'PATH=~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/html/vendor/bin:/var/www/html/bin:/var/www/html/vendor/bin'
++ PATH='~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/html/vendor/bin:/var/www/html/bin:/var/www/html/vendor/bin'
++ '[' -s /nvm.sh ']'
++ '[' -s /bash_completion ']'
++ ls '/home/pnies/.bashrc.d/*'
bash: rm -f /tmp/healthy && /healthcheck.sh: No such file or directory
============= ddev logs =========
+ unset PHP_IDE_CONFIG
+ exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord-nginx-fpm.conf
Server started
2023-04-12 08:36:41,819 INFO Included extra file "/etc/supervisor/php-fpm.conf" during parsing
2023-04-12 08:36:41,819 INFO Included extra file "/etc/supervisor/conf.d/mailhog.conf" during parsing
2023-04-12 08:36:41,819 INFO Included extra file "/etc/supervisor/conf.d/supervisor.conf" during parsing
2023-04-12 08:36:41,822 INFO RPC interface 'supervisor' initialized
2023-04-12 08:36:41,822 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-04-12 08:36:41,822 INFO supervisord started with pid 1
2023-04-12 08:36:42,824 INFO spawned: 'child_exit_monitor' with pid 2213
2023-04-12 08:36:42,825 INFO spawned: 'php-fpm' with pid 2214
2023-04-12 08:36:42,826 INFO spawned: 'nginx' with pid 2215
2023-04-12 08:36:42,827 INFO spawned: 'mailhog' with pid 2216
[12-Apr-2023 08:36:42] NOTICE: fpm is running, pid 2214
[12-Apr-2023 08:36:42] NOTICE: ready to handle connections
[12-Apr-2023 08:36:42] NOTICE: systemd monitor interval set to 10000ms
2023-04-12 08:36:43,889 INFO success: child_exit_monitor entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-12 08:36:43,889 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-12 08:36:43,889 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-04-12 08:36:43,889 INFO success: mailhog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
============= contents of /mnt/ddev_config  =========
Error: No such container: ddev-d9-db
======== Curl of site from inside container:
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 12 Apr 2023 08:36:46 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding

======== curl -I of http://tryddevproject-16796.ddev.site from outside:
curl: (7) Failed to connect to tryddevproject-16796.ddev.site port 80 after 8 ms: Connection refused
Unable to curl the requested project Please provide this output in a new gist at gist.github.com.

Please delete this project after debugging with 'ddev delete -Oy tryddevproject-16796'
Failed running test_ddev.sh: exit status 1
. You can run it manually with `curl -sL -O https://raw.githubusercontent.com/drud/ddev/master/cmd/ddev/cmd/scripts/test_ddev.sh && bash test_ddev.sh`


Expected Behavior
DDEV should start the project as usual
Actual Behavior
DDEV no longer starts the projects. A port that is supposedly not available is reported at random.
Sometimes it is port 80, then 443, then 3307 again.
Steps To Reproduce

Windows 11 with WSL 2 and DDEV
Install KB5025239 update (Released 12.04.2023)
Try to start any Project

Anything else?
I now have 2 completely different Windows 11 computers where DDEV no longer starts.
The Windows 11 update released today was installed on both machines.
Since then, no project can be started. On one computer we have DDEV version 1.21.6 and on the other 1.21.4.
Before installing the update, everything ran as usual. Multiple restarts and DDEV troubleshooting brought no help.

Duplicate issue #4573: wsl pre-release 1.1.0.0 has trouble: ddev-routing ports 80 and 443 error
Created: 2023-01-21T16:29:13Z
Is there an existing issue for this?

 I have searched the existing issues

Run a Diagnostic and Paste Link Here
Hi everyone, when i try run ddev start i have this problem:
Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:443 -> 0.0.0.0:0: listen tcp 127.0.0.1:443: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted. Failed to start xxxxx: failed to start ddev-router: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-xxxxx docker-compose -f /home/xxxxx/.ddev/.router-compose-full.yaml -p ddev-router up -d', action='[-p ddev-router up -d]', err='exit status 1', stdout='', stderr='Container ddev-router  Creating Container ddev-router  Created Container ddev-router  Starting Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:443 -> 0.0.0.0:0: listen tcp 127.0.0.1:443: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.'
Expected Behavior
start ddev -.-
Actual Behavior
not start ddev -.-
Steps To Reproduce
No response
Anything else?
No response

Closing comment (2023-04-14T13:25:34Z): Related to #4809 .