vscode: VS Code is unable to activate a debugger extension because of path casing discrepancies

  • VS Code Version: 1.54.1
  • OS Version: Windows 10 19041

More information here: https://github.com/microsoft/vscode-cpptools/issues/7114

I want to highlight this from the customer’s logs. They are trying to load the ms-vscode.cpptools extension, but the reasoning in the log does not make sense because ms-vscode.cpptools registers the 'cppvsdbg' debugger type). Downgrading VS Code to 1.53.2 fixes the issue for the customer. We’re not sure what would cause this.

[2021-03-05 16:49:27.882] [exthost] [error] Activating extension ms-vscode.cpptools failed due to an error:
[2021-03-05 16:49:27.886] [exthost] [error] Error: a DebugAdapterDescriptorFactory can only be registered from the extension that defines the 'cppvsdbg' debugger.
	at m.registerDebugAdapterDescriptorFactory (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:25505)
	at Object.registerDebugAdapterDescriptorFactory (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:37807)
	at Object.initialize (c:\Users\sesa404214\.vscode\extensions\ms-vscode.cpptools-1.2.2\dist\main.js:18300:35)
	at c:\Users\sesa404214\.vscode\extensions\ms-vscode.cpptools-1.2.2\dist\main.js:26903:27
	at Generator.next (<anonymous>)
	at c:\Users\sesa404214\.vscode\extensions\ms-vscode.cpptools-1.2.2\dist\main.js:26841:71
	at new Promise (<anonymous>)
	at module.exports.__awaiter (c:\Users\sesa404214\.vscode\extensions\ms-vscode.cpptools-1.2.2\dist\main.js:26837:12)
	at activate (c:\Users\sesa404214\.vscode\extensions\ms-vscode.cpptools-1.2.2\dist\main.js:26870:12)
	at Function._callActivateOptional (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:14037)
	at Function._callActivate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:13714)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:11746
	at processTicksAndRejections (internal/process/task_queues.js:97:5)

Does this issue occur when all extensions are disabled?: No

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 32 (26 by maintainers)

Commits related to this issue

Most upvoted comments

This is a fun one, the problematic call was the conversion from fs.realpath callback version to the promise version on line https://github.com/microsoft/vscode/commit/b28cd23d521059938e08515618cdc670f3baa79b#diff-505206763bd72133dfaa593fe504440c0d863477741e23d87ed706bca6aa8a57R55 . Node gives different results for these.

> fs.realpath('.\\vscode-oss\\vscode\\extensions\\microsoft-authentication\\out\\extension.js', (err, path) => console.log(path))
undefined
> A:\vscode-oss\vscode\extensions\microsoft-authentication\out\extension.js

>
> fs.promises.realpath('.\\vscode-oss\\vscode\\extensions\\microsoft-authentication\\out\\extension.js').then((path) => console.log(path))
Promise { <pending> }
> D:\github\vscode-subst\vscode-oss\vscode\extensions\microsoft-authentication\out\extension.js

This fix has been pushed to main for insiders but also a recovery for Feb.

The fix for this should also fix the following issues:

And maybe:

It would be great to figure out if this is indeed a regression from us or not, as such, posting Windows standalone versions of VSCode to try to see whether the issue reproduces:

* `1.53.x` (this version [updated](https://code.visualstudio.com/updates/v1_53#_electron-11-update) Electron to 11): [Download](https://az764295.vo.msecnd.net/stable/622cb03f7e070a9670c94bae1a45d78d7181fbd4/VSCode-win32-x64-1.53.2.zip)

* `1.52.x` (this version still runs with Electron 9): [Download](https://az764295.vo.msecnd.net/stable/ea3859d4ba2f3e577a159bc91e3074c5d85c0523/VSCode-win32-x64-1.52.1.zip)

If I run with 1.54.1 it fails. If I run with 1.53.2 it does NOT fail.

There is indeed electron minor version bump from 1.53.2 to 1.54.0 but there is no node version change and I have looked through the electron commits, nothing related to this code path in node was changed.

To rule out runtime effects, I updated 1.54 branch to same runtime as 1.53 and followed steps https://github.com/microsoft/vscode/issues/118812#issuecomment-797527967, the issue was still reproducible. I also switched the runtime to use binaries from https://electronjs.org/ to rule out any internal patches.

So this is purely a regression on our app code, performing a git bisect now.