Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Debug Adapter #949

Open
andrew-laughlin opened this issue Jan 9, 2024 · 7 comments
Open

Invalid Debug Adapter #949

andrew-laughlin opened this issue Jan 9, 2024 · 7 comments

Comments

@andrew-laughlin
Copy link

PHP version: 8.3
Xdebug version: 3.3
VS Code extension version: 1.34.0

Your launch.json:

    {
        "name": "Listen for Xdebug",
        "type": "php",
        "request": "launch",
        "port": 9003
    }

Xdebug php.ini config:
[xdebug]
zend_extension = /home/user/.config/Local/lightning-services/php-8.3.0+1/bin/linux/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so
xdebug.mode=debug,develop
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.discover_client_host=yes

Xdebug logfile (from setting xdebug.log in php.ini):
VS Code extension logfile (from setting "log": true in launch.json):

Code snippet to reproduce:

When stopping a debugging session (by clicking stop on the debug bar), the following is consistently displayed in the VSCode output window (with "Extension Host") selected.

2024-01-08 19:16:38.585 [error] Error: Invalid debug adapter
at v.m (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1553:95)
at v.$acceptDAError (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1552:7629)
at m.S (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1561:18889)
at m.Q (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1561:18655)
at m.M (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1561:17748)
at m.L (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1561:16827)
at o.value (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1561:15630)
at u.y (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
at u.fire (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:87:2119)
at s.fire (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:616:14449)
at x.onmessage (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1657:7802)

@zobo
Copy link
Contributor

zobo commented Jan 9, 2024

Hi. Are you on linux or on mac?

Does this happen even if no debug session is established?
By that I mean you start Listen for Xdebug and then click stop before any PHP script gets run.

It'd be really helpful if you could provide "log":true debug contents from the Debug Console.

@andrew-laughlin
Copy link
Author

Thanks for the quick response. I'm on Debian 11.

Does this happen even if no debug session is established?
By that I mean you start Listen for Xdebug and then click stop before any PHP script gets run.

That's correct. If I start, then stop the debug session, the "Invalid Debug Adapter" error is shown twice in the output window. Below is the debug console output. In this session, there is 1 breakpoint set.


Listening on { address: '::', family: 'IPv6', port: 9003 }
<- launchResponse
Response { seq: 0, type: 'response', request_seq: 2, command: 'launch', success: true }
<- initializedEvent
InitializedEvent { seq: 0, type: 'event', event: 'initialized' }
-> setBreakpointsRequest
{ command: 'setBreakpoints',
  arguments:
   { source:
      { name: 'Config.php',
        path:
         '/home/user/Local Sites/site4/app/public/wp-content/plugins/FmcsaConnector/src/Config.php' },
     lines: [ 12 ],
     breakpoints: [ { line: 12 } ],
     sourceModified: false },
  type: 'request',
  seq: 3 }
<- setBreakpointsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 3,
  command: 'setBreakpoints',
  success: true,
  body:
   { breakpoints:
      [ { verified: true,
          line: 12,
          source:
           { name: 'Config.php',
             path:
              '/home/user/Local Sites/site4/app/public/wp-content/plugins/FmcsaConnector/src/Config.php' },
          id: 1 } ] } }
-> setFunctionBreakpointsRequest
{ command: 'setFunctionBreakpoints',
  arguments: { breakpoints: [] },
  type: 'request',
  seq: 4 }
<- setFunctionBreakpointsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 4,
  command: 'setFunctionBreakpoints',
  success: true,
  body: { breakpoints: [] } }
-> setExceptionBreakpointsRequest
{ command: 'setExceptionBreakpoints',
  arguments: { filters: [ 'Error' ] },
  type: 'request',
  seq: 5 }
<- setExceptionBreakpointsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 5,
  command: 'setExceptionBreakpoints',
  success: true,
  body: { breakpoints: [ { verified: true, id: 2 } ] } }
-> configurationDoneRequest
{ command: 'configurationDone', type: 'request', seq: 6 }
<- configurationDoneResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 6,
  command: 'configurationDone',
  success: true }
-> threadsRequest
{ command: 'threads', type: 'request', seq: 7 }
<- threadsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 7,
  command: 'threads',
  success: true,
  body: { threads: [] } }
-> disconnectRequest
{ command: 'disconnect',
  arguments: { restart: false, terminateDebuggee: true },
  type: 'request',
  seq: 8 }
<- disconnectResponse
Response { seq: 0, type: 'response', request_seq: 8, command: 'disconnect', success: true }

@zobo
Copy link
Contributor

zobo commented Jan 9, 2024

Thanks. I'll try to reproduce it.
Also. Do you have any other php related vscode extensions installed?

Theres also an "extension bisect" process I'll ask you to do, if I can't reproduce the problem.

Best!

@andrew-laughlin
Copy link
Author

andrew-laughlin commented Jan 9, 2024

A little more about my setup. I'm working on a Wordpress plugin and using Local 8.2 (which includes Xdebug 3.3.0). For unit tests I've been using the Devsense PHP extension (v1.42.14626). I've disabled this extension for troubleshooting.

The only other installed extension are .NET related.

@zobo
Copy link
Contributor

zobo commented Jan 9, 2024

Devsense and this plugin are sadly incompatible and "strange things" happen. Does the error happen when Devsense is disabled?

@andrew-laughlin
Copy link
Author

andrew-laughlin commented Jan 9, 2024 via email

@zobo
Copy link
Contributor

zobo commented Jan 10, 2024

I can confirm this does happen. I tried it on my windows PC and there it does not, then I tried Remote SSH to my debian VM and there I see it. When I stop the debugger, I get two of these exceptions.

The exception seems to happen on the fronted tho (see the paths)

image

In any case, debugging seems to work. I'll try to poke around this and report it to the vscode team...

Version: 1.85.1 (user setup)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants