ddev: ddev-router fails to become ready if two containers expose the same numbered internal port
Run a Diagnostic and Paste Link Here
https://gist.github.com/justafish/bc089ef9043796df9a382f85cc64971a
Describe the bug
- Followed these instructions and added a service that exposes the same ports
- Restarted ddev
- ddev-router hangs
... Container ddev-drainpipe-test-firefox Started Container ddev-router Creating Container ddev-router Created Container ddev-router Starting Container ddev-router Started Failed to restart drainpipe-test: ddev-router failed to become ready; debug with 'docker logs ddev-router'; logOutput=, err=health check timed out: labels map[com.docker.compose.service:ddev-router] timed out without becoming healthy, status=
❯ docker logs ddev-router
Using the local CA at "/root/.local/share/mkcert" ✨
The local CA is now installed in the system trust store! ⚡️
Using the local CA at "/root/.local/share/mkcert" ✨
Created a new certificate valid for the following names 📜
- "*.ddev.local"
- "*.ddev.site"
- "127.0.0.1"
- "localhost"
- "ddev-router"
- "ddev-router.ddev_default"
Reminder: X.509 wildcards only go one level deep, so this won't match a.b.ddev.local ℹ️
The certificate is at "/etc/nginx/certs/.crt" and the key at "/etc/nginx/certs/.key" ✅
Using the local CA at "/root/.local/share/mkcert" ✨
Created a new certificate valid for the following names 📜
- "*.ddev.local"
- "*.ddev.site"
- "ddev-router"
- "ddev-router.ddev_default"
- "127.0.0.1"
- "localhost"
Reminder: X.509 wildcards only go one level deep, so this won't match a.b.ddev.local ℹ️
The certificate is at "/etc/nginx/certs/master.crt" and the key at "/etc/nginx/certs/master.key" ✅
forego | starting nginx.1 on port 5000
forego | starting dockergen.1 on port 5100
dockergen.1 | 2022/03/04 16:04:23 Generated '/gen-cert-and-nginx-config.sh' from 6 containers
dockergen.1 | 2022/03/04 16:04:23 Running 'bash /gen-cert-and-nginx-config.sh'
dockergen.1 | 2022/03/04 16:04:23 [bash /gen-cert-and-nginx-config.sh]: Processing certs and nginx for hostnames: *.drainpipe-test.ddev.site drainpipe-test.ddev.site
dockergen.1 | 2022/03/04 16:04:23 [bash /gen-cert-and-nginx-config.sh]: - "*.drainpipe-test.ddev.site"
dockergen.1 | /03/04 16:04:23 Error running notify command: nginx -s reload, exit status 1
dockergen.1 | 2022/03/04 16:04:23 Watching docker events
dockergen.1 | 2022/03/04 16:04:24 Contents of /gen-cert-and-nginx-config.sh did not change. Skipping notification 'bash /gen-cert-and-nginx-config.sh'
To Reproduce
- Add
.ddev/docker-compose.selenium.yaml
version: '3.6'
services:
chrome:
container_name: ddev-${DDEV_SITENAME}-chrome
image: selenium/standalone-chrome:4.1.2-20220217
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
expose:
- 7900
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTPS_EXPOSE=7900:7900
- HTTP_EXPOSE=7901:7900
links:
- web:web
- web:drupal_chrome
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
volumes:
- ".:/mnt/ddev_config"
firefox:
container_name: ddev-${DDEV_SITENAME}-firefox
image: selenium/standalone-firefox:4.1.2-20220217
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
expose:
- 7900
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTPS_EXPOSE=7902:7900
- HTTP_EXPOSE=7903:7900
links:
- web:web
- web:drupal_firefox
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
volumes:
- ".:/mnt/ddev_config"
- Run
ddev restart
Expected behavior
Selenium front-end is available on http://drainpipe-test.ddev.site:7900, http://drainpipe-test.ddev.site:7902, http://drainpipe-test.ddev.site:7901, and http://drainpipe-test.ddev.site:7904
Version and configuration information (please complete the following information)
- ddev version v1.18.2
- Docker version 20.10.12, build e91ed57
- `Linux asterix 5.14.0-1024-oem #26-Ubuntu SMP Thu Feb 17 14:35:50 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
- config.yml`
name: drainpipe-test
type: drupal9
docroot: web
php_version: "7.4"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames:
- '*.drainpipe-test'
additional_fqdns: []
mariadb_version: "10.4"
mysql_version: ""
nfs_mount_enabled: false
mutagen_enabled: false
hooks:
post-start:
- exec: mysql -uroot -proot -hdb -e "CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';"
- exec: mysql -uroot -proot -hdb -e "CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';"
use_dns_when_possible: true
composer_version: "2"
web_environment:
- NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox
- NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (23 by maintainers)
Commits related to this issue
- Fix Selenium containers for DDEV. See https://github.com/drud/ddev/issues/3658 — committed to Lullabot/drainpipe-dev by justafish 2 years ago
https://github.com/Lullabot/drainpipe-dev/pull/38 😃