xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
771 stars 176 forks source link

dbgpProxy problem when connecting #843

Closed enboig closed 1 year ago

enboig commented 1 year ago

PHP version: 7.2 Xdebug version: v3.1.5, VS Code extension version: v1.28.0

I am unable to use it, when proxy connects to my client there is an error. I upgraded xdebug extension from 2 to 3, so maybe my xdebug.ini is broken.

launch.json:

        {
            "name": "devServer",
            "type": "php",
            "request": "launch",
            "pathMappings": {
                "/var/www/https/project1": "${workspaceFolder}/",
            },
            "proxy":
            {
                "enable": true,
                "host": "192.168.1.166",
                "port": 9072
            }
        },

Xdebug php.ini config:

zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1
xdebug.client_port=9000
xdebug.mode=debug
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_addr_header = "HTTP_X_XDEBUG_REMOTE_ADDRESS"
dbgpProxy -s 0.0.0.0:9000 -i 0.0.0.0:9072
Xdebug DBGp proxy (0.4.2-dev)
Copyright 2020 by Derick Rethans
2022-10-07 13:24:24.964 [warn] [SSL] The 'certs/fullchain.pem' file could not be found, not enabling SSL listeners
2022-10-07 13:24:24.964 [info] [dbgpProxy] Proxy started
2022-10-07 13:24:24.965 [info] [server] Started server server on 0.0.0.0:9000
2022-10-07 13:24:24.965 [info] [server] Started client server on 0.0.0.0:9072
2022-10-07 13:24:28.379 [info] [server] Start new client connection from 192.168.1.71:34046
2022-10-07 13:24:28.881 [info] [proxyinit] [vscclient] Added connection for IDE Key 'vscclient': 192.168.1.71:9003
2022-10-07 13:24:28.881 [info] [server] Closing client connection from 192.168.1.71:34046
2022-10-07 13:24:35.756 [info] [server] Start new server connection from [::1]:40226
2022-10-07 13:24:35.757 [info] [proxy-client] [vscclient] Found connection for IDE Key 'vscclient': 192.168.1.71:9003
2022-10-07 13:24:35.757 [info] [proxy-client] [vscclient] Connecting to 192.168.1.71:9003
2022-10-07 13:24:35.757 [info] [proxy-client] [vscclient] IDE connected
2022-10-07 13:24:35.757 [info] [proxy-client] [vscclient] Init forwarded, start pipe
2022-10-07 13:24:35.916 [info] [server] Start new server connection from [::1]:40228
2022-10-07 13:24:35.916 [info] [proxy-client] [vscclient] Found connection for IDE Key 'vscclient': 192.168.1.71:9003
2022-10-07 13:24:35.916 [info] [proxy-client] [vscclient] Connecting to 192.168.1.71:9003
2022-10-07 13:24:35.917 [info] [proxy-client] [vscclient] IDE connected
2022-10-07 13:24:35.917 [info] [proxy-client] [vscclient] Init forwarded, start pipe
2022-10-07 13:24:36.315 [info] [proxy-client] [vscclient] IDE closed connection
2022-10-07 13:24:36.315 [warn] [server] Handler response error: Error reading response: Error reading length: EOF
2022-10-07 13:24:36.315 [info] [server] Closing server connection from [::1]:40226
2022-10-07 13:24:36.322 [info] [proxy-client] [vscclient] IDE closed connection
zobo commented 1 year ago

What is the error? Can you also add log:true to your launch config to see what the IDE sees? Logs are in Debug Console tab.

Also there are a few Xdebug 2 specific directives in your ini, but that should not cause an issue.

zobo commented 1 year ago

Just wanted to say, I tried a local setup of dbgpProxy again and things work.

enboig commented 1 year ago

I will check locally on Monday. And also check log:true; the odd part is that connection seems to be established...

Thanks, I will report more info as soon as I can.

enboig commented 1 year ago

Extension log reported no problem. After check it worked locally, I found problem wasn't putting breakpoints on the right file. [warn] [server] Handler response error: Error reading response: Error reading length: EOF made me think there was a problem, when there wasn't. Thanks for your time (and your extension ;-) )