ddev: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms (RHEL, Linux, Firewall)
Is there an existing issue for this?
- I have searched the existing issues
Output of ddev debug test
Expected Behavior
When visiting the site, incoming connection from XDebug should trigger within phpstorm
Actual Behavior
Getting below error within ddev container:
Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: 172.17.0.1:9003 (through xdebug.client_host/xdebug.client_port).
Steps To Reproduce
Docker version 24.0.2, build cb74dfc
Docker Compose version v2.18.1
docker-py version: 3.7.2
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
DDEV version - v1.21.6
docker-compose v2.15.1
OS : RHEL 8.8
PHPStorm version : 2023.2 EAP (Tried on PhpStorm 2023.1.2 as well)
- Created a project following this guide : https://ddev.readthedocs.io/en/latest/users/quickstart/#drupal
- Run ddev config, ddev start and ddev xdebug on
- Click on “Start listening for PHP Debug connection” on port 9003
Tried running - sudo lsof -i :9003 -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 32453 minsharm 360u IPv4 434059 0t0 TCP *:9003 (LISTEN)
When i tried running host.docker.internal 9003 in the ddev container:
Trying 172.17.0.1… telnet: Unable to connect to remote host: No route to host
cat /etc/hosts
127.0.0.1 minsharm.remote.csb localhost.localdomain localhost drupalddev.ddev.site ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Anything else?
Client: Docker Engine - Community Cloud integration: v1.0.29 Version: 24.0.2 API version: 1.43 Go version: go1.20.4 Git commit: cb74dfc Built: Thu May 25 21:53:10 2023 OS/Arch: linux/amd64 Context: default
Server: Docker Engine - Community Engine: Version: 24.0.2 API version: 1.43 (minimum version 1.12) Go version: go1.20.4 Git commit: 659604f Built: Thu May 25 21:52:10 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (10 by maintainers)
Hey @rfay Thanks for pointing me in the right direction to debug this issue. You were so right. It was firewall issue only and finally after lot of struggle I am able to solve it. 🎉 Thanks once again for leading me in absolutely correct path and for your time !!
That’s how i resolved this issue.
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9003 -j ACCEPT
[OPTIONAL] Then checked the iptables rule with below command as well
sudo iptables -L
Still get the same error then the last option would be open the port through firewall.
For RHEL, CentOS or Fedora
firewall-cmd --permanent --add-port=9003/tcp firewall-cmd --reload
For Debian and Ubuntu
sudo ufw allow 9003/tcp sudo ufw reload
Yay, thanks for the followup. We all thought firewall was the likely issue.