XDEBUG error in xdebug.log adn error.log

The xdebug.log file is filled every minute with the following warning:

[Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port).

In project_error.log :

*17 FastCGI sent in stderr: "PHP message: Xdebug: [Log Files] File '/var/log/fpm/xdebug.log' could not be opened.PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port)" while reading response header from upstream, client: 172.172.0.2, server: project.develop, request: "POST /wp-cron.php?doing_wp_cron=1678089668.5224909566409667968750 HTTP/1.1", upstream: "fastcgi://172.172.0.2:9003", host: "project.develop:8443", referrer: "https://project.develop:8443/wp-cron.php?doing_wp_cron=1678089668.5224909566409667968750"

Hi @DavidH ,

Thank you for reporting this.
It’s my first time I saw/noticed this xdebug messages in the xdebug.log file as well.

On my Linux machine, when I’m tailing my xdebug.log file (under the~/DevKinsta/logs subfolder), I noticed this:

[Step Debug] ERR: Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port).

While on my Windows machine (same xdebug.log under the C:\Users\mylocaluser\DevKinsta\logs) I noticed similar message (as you reported):

[Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port) :-(

and I am not sure if it’s expected to get those generated in the xdebug.log file each time I tried to load/access the local sites on my browser, and also each time I tried to navigate between sites list in DevKinsta. I will need to check with our internal devs team about this for sure.

Though I didn’t see anything related to that xdebug were generated in my sites’ _error.log files (as you reported above).

Could you please tell if you have enabled Xdebug and/or set it up for your local “project.develop” site (uses port 9003)? :thinking:

-Agus

Hi @Agus

I’am using port 8080 on http and 8443 on https.
I’ve just enabled wp_debug from devKinsta dashboard.
How can I see if xdebug is enabled ? Isn’t it supposed to be activated?

Hey David :slight_smile:

Yup those port 8080 (http) and 8443 (https) were setup in your DevKinsta for the NGINX part, that’s fine.

Yes, you’re correct! XDebug is included with the devkinsta_fpm Docker image starting with DevKinsta 2.8.0. By default, in the “Site configurations” section of each site in DevKinsta, the Xdebug option shows as enabled (green toggle).

Looks like it’s expected to get those messages (like I mentioned above) filled up in the xdebug.log file ( I could see the same on both my Windows and Linux machines ) .

I checked further in my devkinsta_fpm container on Linux, and noticed, this line:

xdebug.start_with_request=yes

that’s defined in the following files:

/etc/php/7.4/mods-available/xdebug.ini
/etc/php/8.0/mods-available/xdebug.ini
/etc/php/8.1/mods-available/xdebug.ini
/etc/php/8.2/mods-available/xdebug.ini

which seems to be the reason of those messages, like:

[Step Debug] ERR: Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port).

Example the contents of xdebug.ini look like these:

root@a8161dfb48b0:/www/kinsta# cat /etc/php/8.0/mods-available/xdebug.ini 
zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
xdebug.client_port=9000
xdebug.log = /var/log/fpm/xdebug.log
xdebug.log_level = 1

I then made the following steps to test further:

  1. I connected to the devkinsta_fpm container as root with this command:
docker exec -it devkinsta_fpm bash
  1. In that devkinsta_fpm container, I downloaded/installed nano (text editor) , so I could edit the xdebug.ini file easily, with this command line:
apt-get update && apt-get install nano
  1. Once nano has been installed in that container, I opened those xdebug.ini files with nano, with the following (1 at a time):
nano /etc/php/7.4/mods-available/xdebug.ini
nano /etc/php/8.0/mods-available/xdebug.ini
nano /etc/php/8.1/mods-available/xdebug.ini
nano /etc/php/8.2/mods-available/xdebug.ini
  1. In that nano editor, I changed this line xdebug.start_with_request=yes (in each of those xdebug.ini files of those PHP folders) to be as follow:

xdebug.start_with_request=trigger

(pressed “Control O” and Enter, to write/save the changes in Nano editor)

  1. After those 4 xdebug.ini files have been changed, I also went to DevKinsta → Sites → my Site Name → Wrench icon (Site configurations) , and there in the “PHP.ini Editor” section I added this line as well (and clicked “Save changes” button ):

xdebug.start_with_request=trigger

After that, I’m No longer seeing my xdebug.log file getting filled with those messages mentioned above.

So I think, you may want to either just ignore those messages in the xdebug.log and the error.log - as those were not critical or fatal error (and should not affect your site at all),
OR
if you don’t want those messages filling up in your log files, then you may want to consider the steps I took (mentioned) above, and see if that will stop those messages to be logged in your xdebug.log and/or error.log files.

Cheers,
Agus

Thanks @Agus

it seems to be good. I’ve only added xdebug.start_with_request=trigger in PHP.ini and activat Xdebug.
project_error.log and xdebug.log are now empty.
Because I want the file to be empty or only filled by the development (warning deprecated, errors), this way we can identify and correct easily.

1 Like

You’re most welcome David! :bowing_man:
Glad to hear that workaround I suggested works for you! :clap:

Cheers,
Agus

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.