VS Code still have to access internet when installing extensions with local VSIX file
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.63.2
- OS Version: Windows 10 20H2 and Ubuntu 18.04.5 (with remote-ssh scenario)
Steps to Reproduce:
- Scenario A: Install extension with a VSIX file using command line tool on Windows 10 or Ubuntu 18.04.5
- Prepare an extension vsix file (e.g., Prettier or Python)
- Use the following command to install extension with the vsix file
code --install-extension <path to the vsix file>
- Scenario B: Install extension with a VSIX file using VS Code UI on Windows 10
- Prepare an extension vsix file (e.g., Prettier or Python)
- In the âExtensionsâ view, click âInstall from VSIXâ and select the vsix file to be installed.
- Scenario C: Install extension with a VSIX file using VS Code UI on remote Ubuntu Server (remote-ssh activated)
- Setup remote-ssh extension and environment settings
- Connect to the remote Ubuntu server
- In the remote-ssh VS Code window, click âInstall from VSIXâ and select the vsix file on the remote Ubuntu server to be installed.
Problem States:
In my company network, both local Windows PC and remote Ubuntu Linux terminal server are not allowed to access internet with firewall settings blocked. Therefore, I downloaded the extension vsix files in my home and sent them to my company PC and installed them with the steps mentioned above. However, I found that when installing extensions from vsix files, before VS Code start to extract contents from the vsix files, VS Code still tried to access the Microsoft marketplace, which makes it waste a lot of time (about 2minutes per installation) waiting VS Code request timeout and then start to do the extraction and installation. In my understanding, all the content needed for installing an extension are all included in the vsix file. Why do VS Code still need to send POST request to marketplace every time at the beginning when installing from vsix file? Or, if is it possible to provide a configuration option to disable this behavior, or at least make users have a chance to set the timeout value for requests sent by VS Code to Microsoft marketplace?
Here is the log when installing extension with vsix file on my PC which can access internet (I set --log trace
),
as you can see, it accessed the marketplace in the log
TRACE RequestService#request https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery
TRACE Started scanning user extensions
INFO CLI main {
_: [],
diff: false,
add: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
help: false,
'list-extensions': false,
'show-versions': false,
'install-extension': [
'C:\\Users\\mtk23649.DOMAIN_MTK\\Desktop\\VSCode Portable\\extensions\\esbenp.prettier-vscode\\esbenp.prettier-vscode-9.1.0.vsix'
],
'pre-release': false,
version: false,
verbose: false,
log: 'trace',
status: false,
'prof-startup': false,
'no-cached-data': false,
'prof-v8-extensions': false,
'disable-extensions': false,
'disable-gpu': false,
'ms-enable-electron-run-as-node': false,
telemetry: false,
debugRenderer: false,
logExtensionHostCommunication: false,
'skip-release-notes': false,
'skip-welcome': false,
'disable-telemetry': false,
'disable-updates': false,
'disable-keytar': false,
'disable-workspace-trust': false,
'disable-crash-reporter': false,
'skip-add-to-recently-opened': false,
'unity-launch': false,
'open-url': false,
'file-write': false,
'file-chmod': false,
'driver-verbose': false,
force: false,
'do-not-sync': false,
trace: false,
'force-user-env': false,
'force-disable-user-env': false,
'open-devtools': false,
__sandbox: false,
'no-proxy-server': false,
'no-sandbox': false,
nolazy: false,
'force-renderer-accessibility': false,
'ignore-certificate-errors': false,
'allow-insecure-localhost': false,
logsPath: 'C:\\Users\\mtk23649.DOMAIN_MTK\\Desktop\\VSCode Portable\\stables\\VSCode-win32-x64-1.63.2\\data\\user-data\\logs\\20220211T152929'
}
Installing extensions...
TRACE Started scanning user extensions
TRACE Scanned user extensions: 4
TRACE Scanned user extensions: 4
(node:28292) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
TRACE Started scanning user extensions
TRACE Scanned user extensions: 4
TRACE ExtensionManagementService#install file:///c%3A/Users/mtk23649.DOMAIN_MTK/Desktop/VSCode%20Portable/extensions/esbenp.prettier-vscode/esbenp.prettier-vscode-9.1.0.vsix
INFO Installing extension: esbenp.prettier-vscode
TRACE Started scanning system extensions
TRACE Started scanning user extensions
TRACE Scanned user extensions: 4
TRACE Scanned system extensions: 86
TRACE Started scanning system extensions
TRACE Started scanning user extensions
TRACE Scanned user extensions: 4
TRACE Scanned system extensions: 86
TRACE Started scanning user extensions
TRACE Scanned user extensions: 4
TRACE RequestService#request https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery
TRACE resolveShellEnv(): skipped (Windows)
TRACE Started extracting the extension from c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\extensions\esbenp.prettier-vscode\esbenp.prettier-vscode-9.1.0.vsix to C:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [ADDED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
TRACE [File Watcher (node.js)] [CHANGED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224
INFO Extracted extension to C:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\.3be0a99b-f662-4b55-8289-5651a1ebb224: esbenp.prettier-vscode
TRACE [File Watcher (node.js)] [ADDED] c:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\esbenp.prettier-vscode-9.1.0
INFO Renamed to C:\Users\mtk23649.DOMAIN_MTK\Desktop\VSCode Portable\stables\VSCode-win32-x64-1.63.2\data\extensions\esbenp.prettier-vscode-9.1.0
INFO Extracting completed. esbenp.prettier-vscode
INFO Extension installed successfully: esbenp.prettier-vscode
Extension 'esbenp.prettier-vscode-9.1.0.vsix' was successfully installed.
Here is the log when installing extension from vsix file on the PC which canât access internet: (It spent too much time, just like the program freezed, so I stop the process by Ctrl-C)
Installing extensions...
TRACE Started scanning user extensions
TRACE Extension VSIX downlads cache dir does not exist
TRACE Scanned user extensions: 0
TRACE Scanned user extensions: 0
(node:30321) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `code --trace-deprecation ...` to show where the warning was created)
TRACE Started scanning user extensions
TRACE Scanned user extensions: 0
TRACE ExtensionManagementService#install file:///proj/mtk23649/garmin.private-extension-manager-1.8.0.vsix
INFO Installing extension: garmin.private-extension-manager
TRACE Started scanning system extensions
TRACE Started scanning user extensions
TRACE Scanned user extensions: 0
TRACE Scanned system extensions: 85
TRACE RequestService#request https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery
TRACE resolveShellEnv(): skipped (VSCODE_CLI is set)
^C
Issue Analytics
- State:
- Created 2 years ago
- Reactions:26
- Comments:16 (9 by maintainers)
Top GitHub Comments
Yes, I also tested installing from a
vsix
file when my âpersonal PCâ is completed out of internet by removing the ethernet cable from the PC (no remote-ssh to remote Linux server, and no any firewall policy), and it did complete very quickly. So youâre right, the behavior is different in an complete offline (no any network access) vs limited-access (e.g., the request is blocked by outbound firewall policy) environment.Yes, Iâm saying that I think VS Code took so much time installing an extension offline from a vsix file because it reaches out the Microsoft marketplace first before starting extracting contents from the vsix file. And even in the latest 1.70.2 version, the problem is still there.
As you can see in the screenshot above, there is a time gap for about 2 minutes bettwen the log âInstalling extensionâ and the log âExtracted extensionâ. Also, in the Network view of the built-in Developer tool, there are two extensionquery events, one failed, and the other failed due to connection timeout.
In addition, I screenshoted the log of VS Code during installing this extension offline (set log level to
trace
) shown below. Most time was spent on the request tohttps://marketplace.visualstudio.com/_apis/public/gallery/extensionquery
(where I marked with a yellow rectangle).To be clear, the offline installation always succeeds. However, the main problem is that it takes too much time trying to reach out the Microsoft marketplace, which is not necessary in my opinion.