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

Cannot find module 'vscode-windows-ca-certs' #181404

Closed
sandy081 opened this issue May 3, 2023 · 9 comments · Fixed by #182052
Closed

Cannot find module 'vscode-windows-ca-certs' #181404

sandy081 opened this issue May 3, 2023 · 9 comments · Fixed by #182052
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded

Comments

@sandy081
Copy link
Member

sandy081 commented May 3, 2023

Copied from #181400 (comment)

2023-05-03 12:37:03.810 [info] Extension host with pid 2812 started
2023-05-03 12:37:03.832 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2023-05-03 12:37:03.837 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2023-05-03 12:37:03.883 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-05-03 12:37:03.941 [info] Eager extensions activated
2023-05-03 12:37:03.945 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-05-03 12:37:03.947 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-05-03 12:37:03.964 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
2023-05-03 12:37:04.014 [error] ProxyResolver#getCaCertificates error Error: Cannot find module 'vscode-windows-ca-certs'
Require stack:
- c:\Program Files (x86)\Microsoft VS Code\resources\app\node_modules.asar\@vscode\proxy-agent\out\index.js
- c:\Program Files (x86)\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Program Files (x86)\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at b._load (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:126:29948)
	at h._load (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:126:26698)
	at I._load (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:90:24489)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at c:\Program Files (x86)\Microsoft VS Code\resources\app\node_modules.asar\@vscode\proxy-agent\out\index.js:380:71
2023-05-03 12:37:05.488 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-05-03 12:37:05.529 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-05-03 12:39:20.088 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
@sandy081
Copy link
Member Author

sandy081 commented May 3, 2023

By @deepak1556

@joaomoreno based on the error from #181400 (comment), looks like this commit microsoft/vscode-proxy-agent@f8fbc21 was not released and consumed in VSCode

@sandy081
Copy link
Member Author

sandy081 commented May 3, 2023

I assume this change was done in March and therefore it also exists in 1.77.0 ?

@joaomoreno
Copy link
Member

joaomoreno commented May 3, 2023

Not sure why you're assuming the change was done in March. The change was done in April: 9008956. It's new in 1.78.0.

This breaks automatic proxy discovery in the extension host on Windows platforms only. I don't think it's a stop ship because:

  1. It affects extension host on Windows only.
  2. It affects users who rely on automatic proxy discovery. There is a workaround: manually configure the proxy on VS Code.
  3. There were seemingly no reports of breakage the entire month of April on Insiders.

I suggest merging the fix in as a candidate of an April recovery milestone. Leaving it to you @sandy081, as endgame champ, to chime in.

@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release labels May 3, 2023
@sandy081
Copy link
Member Author

sandy081 commented May 3, 2023

Not sure why you're assuming the change was done in March.

Because I saw the dependency on @vscode/windows-ca-certs was added in March - https://github.com/microsoft/vscode-proxy-agent/pull/3/files. May be this is nothing to do with this change.

I agree to take this as a candidate for next recovery

@chrmarti
Copy link
Contributor

chrmarti commented May 3, 2023

Just to clarify: This breaks loading of OS certificates on Windows (not proxy discovery). This will affect users relying on self-signed certificates for development and those requiring a CA certificate from their network proxy. Only HTTP/S requests made by extensions using the Node API are affected.

@gjsjohnmurray
Copy link
Contributor

Can a test get added to prevent this from happening again?

@vrv7567
Copy link

vrv7567 commented May 9, 2023

@sandy081 This is also affecting remote-containers extension.
I'm trying to open a folder in my remote linux machine using remote-containers extension in vscode(windows workstation).
It just silently fails with the following error:

2023-05-09 16:06:41.935 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2023-05-09 16:06:42.289 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-05-09 16:08:16.280 [error] ProxyResolver#getCaCertificates error Error: Cannot find module 'vscode-windows-ca-certs'
Require stack:
- c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\@vscode\proxy-agent\out\index.js
- c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at b._load (c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:126:29948)
	at h._load (c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:126:26698)
	at I._load (c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:90:24489)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at c:\Users\dogma\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\@vscode\proxy-agent\out\index.js:380:71
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-05-09 16:08:16.498 [error] Error: unable to get local issuer certificate
	at TLSSocket.onConnectSecure (node:_tls_wrap:1535:34)
	at TLSSocket.emit (node:events:513:28)
	at TLSSocket._finishInit (node:_tls_wrap:949:8)
	at ssl.onhandshakedone (node:_tls_wrap:730:12) remote-containers.openFolder {"value":"ms-vscode-remote.remote-containers","c":"ms-vscode-remote.remote-containers"}

@vrv7567
Copy link

vrv7567 commented May 9, 2023

Thanks @joaomoreno Manually setting the proxy in remote settings worked for me
image

@joaomoreno
Copy link
Member

Verification:

  1. Launch VS Code on Windows
  2. Open the Extension Host output channel
  3. Verify that there's no exception regarding vscode-windows-ca-certs
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants