microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.51k stars 28.65k forks source link

Error: End of central directory record signature not found. Either not a zip file, or file is truncated. #215612

Closed DFelten closed 2 months ago

DFelten commented 3 months ago

Type: Bug

There is a problem when trying to install or update several extensions with the latest version of VSCode. The problem did not occur with a previous version.

For example GitHub Actions or Rainbow CSV is not longer possible to install or update. There is just an error with this log:

2024-06-15 12:25:01.393 [error] Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26640)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28083
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)
2024-06-15 12:25:01.404 [error] End of central directory record signature not found. Either not a zip file, or file is truncated.: Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26640)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28083
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)

VS Code version: Code - Insiders 1.91.0-insider (0da59bdde2339d6ba632524dc8f3fb6f4b8a2bcb, 2024-06-14T10:10:26.619Z) OS version: Darwin arm64 23.5.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|5, 9, 7| |Memory (System)|32.00GB (0.95GB free)| |Process Argv|--crash-reporter-id 511166e9-0c5e-4225-a6af-efd2d90c3f8d| |Screen Reader|no| |VM|0%|
Extensions (82) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 codesnap|adp|1.3.4 vscode-m3u|af4|1.0.0 TabOut|alb|0.2.2 Bookmarks|ale|13.5.0 project-manager|ale|12.8.0 flutter-snippets|ale|3.0.0 toggle-excluded-files|amo|2.0.0 clipboard-history|Anj|1.0.7 melos-code|bla|1.1.1 vscode-intelephense-client|bme|1.10.4 ccs-flutter-color|cir|1.2.4 gitignore|cod|0.9.0 dbclient-jdbc|cwe|1.3.5 vscode-mysql-client2|cwe|7.4.9 vscode-mac-color-picker|dae|1.1.0 markdown-table-prettify|dar|3.6.0 dart-code|Dar|3.90.0 flutter|Dar|3.90.0 vscode-markdownlint|Dav|0.55.0 githistory|don|0.6.20 xml|Dot|2.5.1 gitlens|eam|15.1.0 bloc|Fel|6.6.6 mason|Fel|0.1.12 flutter-coverage|flu|0.0.4 shell-format|fox|7.2.5 build-runner|gae|0.8.0 copilot|Git|1.203.0 copilot-chat|Git|0.17.2024061401 vscode-pull-request-github|Git|0.88.1 todo-tree|Gru|0.0.226 json-to-dart|hir|3.5.8 rest-client|hum|0.25.1 pubspec-assist|jer|2.3.2 shortcut-menu-bar|jer|3.0.4 intellij-idea-keybindings|k--|1.7.2 build-runner|Kai|2.1.1 chatgpt-helper|kir|4.1.0 vscode-gutter-preview|kis|0.31.2 indent-to-bracket|LAK|1.2.2 flutter-intl|loc|1.19.3 syntax-project-pbxproj|mar|0.1.3 flutter-snippets|Mar|1.0.5 Kotlin|mat|1.7.1 git-graph|mhu|1.30.0 dart-barrel-file-generator|miq|6.2.2 diff-merge|mos|0.7.0 vscode-apache|mrm|1.2.0 vscode-docker|ms-|1.29.1 vscode-language-pack-de|MS-|1.89.2024050109 remote-containers|ms-|0.373.0 live-server|ms-|0.4.13 vscode-speech|ms-|0.10.0 vsliveshare|ms-|1.0.5932 vsliveshare-pack|ms-|0.4.0 vscode-flutter-freezed-helper|mth|0.1.0 sqltools|mtx|0.28.3 sqltools-driver-mysql|mtx|0.6.2 awesome-flutter-snippets|Nas|4.0.1 vscode-streamdeck|nic|4.1.6 vscode-yaml-sort|Pas|6.5.17 vscode-versionlens|pfl|1.14.2 material-icon-theme|PKi|5.4.2 remove-comments|pli|1.2.2 vscode-yaml|red|1.15.0 vscode-sort-json|ric|1.20.0 command-variable|rio|1.63.0 flutter-riverpod-snippets|rob|1.2.2 vscode-coverage-gutters|rya|2.11.1 lcov-lang|Ser|1.0.1 swift-lang|ssw|1.10.1 freezed-model-gen|Sus|1.0.1 better-search|tra|0.0.6 errorlens|use|3.18.0 vscode-lldb|vad|1.10.0 vscode-wakatime|Wak|24.6.0 vscode-todo-highlight|way|1.0.5 php-debug|xde|1.34.0 vscode-surround|yat|1.5.0 markdown-all-in-one|yzh|3.6.2 material-theme|zhu|3.17.2 (3 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256198 vsc_aa:30263845 vscod805cf:30301675 vsaa593cf:30376535 py29gd2263:31024238 c4g48928:30535728 962ge761:30841072 pythongtdpath:30726887 welcomedialog:30812478 pythonidxpt:30768918 pythonnoceb:30776497 asynctok:30898717 dsvsc013:30777762 dsvsc014:30777825 dsvsc015:30821418 pythontestfixt:30866404 pythonregdiag2:30926734 pythonmypyd1:30859725 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 cppperfnew:30980852 pythonait:30973460 jchc7451:31067543 showvideot:31016890 chatpanelt:31014475 0ee40948:31013168 a69g1124:31018687 dvdeprecation:31040973 pythonprt:31036556 dwnewjupyter:31046869 nb_pkg_only:31057982 nativerepl2:31071685 refactort:31073763 ```
sandy081 commented 3 months ago

Can you please clear following folder and retry?

DFelten commented 3 months ago

Can you please clear following folder and retry?

  • F1 > Open User Data Folder
  • Clear CachedExtensionVSIXs folder

@sandy081 I deleted the folder, but the problem still occurs. Even after a restart of VSCode after deleting the folder it's still not working.

[error] End of central directory record signature not found. Either not a zip file, or file is truncated.: Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26640)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28083
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)
sandy081 commented 3 months ago

Are you seeing this issue for a specific extension or for all?

DFelten commented 3 months ago

Are you seeing this issue for a specific extension or for all?

The error appears on multiple extensions. For example I can't install the updates for

After an uninstall of the old version I can't install the latest version of GitHub Actions.

sandy081 commented 3 months ago

Can you please launch VS Code using different user data directory and extensions directory and see if you can reproduce the issue?

From CLI - code --user-data-dir <new folder> --extensions-dir <new folder>

DFelten commented 3 months ago

@sandy081 I will test that. What are the implications of this customization and how can I reset it to the default afterwards?

sandy081 commented 2 months ago

This does not impact your default installation. Starting VS Code normally without above arguments will bring back your default set up

DFelten commented 2 months ago

When starting VSCode via code-insiders --user-data-dir <new folder> --extensions-dir <new folder> it's possible to install or update the extensions.

After starting VSCode normal, then the error is there again.

sandy081 commented 2 months ago

Just to confirm, you are reproducing the issue on VS Code or VS Code Insiders?

@deepak1556 Wondering if there is a network cache folder that the application has from where the VSIXs are being picked up? Scenario is user is seeing extension installation error because of corrupted VSIX. When asked to try the same on a fresh user data / extensions folder, it works.

@DFelten Can you please share the VSIX from CachedExtensionVSIXs folder that is causing this error?

deepak1556 commented 2 months ago

We do have http cache in the user data directory, that is used by the chromium network stack.

@DFelten can you start the application with code-insiders --log-net-log=/tmp/netlog.json and perform the extension install or update steps that triggers the error. Once the error is seen quit the application. You can send the generated network logs to Deepak.Mohan@microsoft.com

DFelten commented 2 months ago

Since yesterday the extensions have suddenly been updated again. Unfortunately I can't say what has changed.

But the problem seems to have solved itself. If it comes up again, I will reopen the ticket.

taldcroft commented 1 month ago

I'm seeing this same issue today for the Python extension.

Version: 1.91.1 (Universal)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:07:54.982Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.4.0

I tried clearing the CachedExtensionVSIXs but this did not help. Here is the full log when I try to update that extension:

2024-07-22 08:00:13.125 [info] Started local extension host with pid 13769.
2024-07-22 08:00:13.348 [error] Extension 'ms-python.debugpy' appears in product.json but enables LESS API proposals than the extension wants.
package.json (LOSES): portsAttributes, contribIssueReporter, debugVisualization, contribViewsWelcome
product.json (WINS): portsAttributes, contribIssueReporter, debugVisualization
2024-07-22 08:00:13.794 [error] [Extension Host] Error: Cannot find module '@microsoft/dynamicproto-js'
Require stack:
- /Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at i._resolveFilename (node:electron/js2c/utility_init:2:13405)
    at Module._load (node:internal/modules/cjs/loader:908:27)
    at c._load (node:electron/js2c/node_init:2:13672)
    at S._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:177:6035)
    at n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:31788)
    at i._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:139:34301)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:647)
    at 9547 (/Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:891032)
    at n (/Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:1127826)
    at 7164 (/Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:42591)
    at n (/Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:1127826)
    at /Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:217885
    at async /Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:217849
    at async t.oneDataSystemClientFactory (/Users/aldcroft/.vscode/extensions/ms-python.debugpy-2024.9.12041013-darwin-arm64/dist/extension.js:2:217820)
2024-07-22 08:00:14.547 [error] Unhandled method getIdAtPosition: Error: Unhandled method getIdAtPosition
    at /Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:398068
    at re (/Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:398362)
    at /Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:393146
    at Immediate.<anonymous> (/Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:393166)
    at processImmediate (node:internal/timers:478:21)
2024-07-22 08:00:14.827 [error] [Extension Host] (node:13769) [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 Helper (Plugin) --trace-deprecation ...` to show where the warning was created)
2024-07-22 08:00:15.706 [error] Unhandled method getIdAtPosition: Error: Unhandled method getIdAtPosition
    at /Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:398068
    at re (/Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:398362)
    at /Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:393146
    at Immediate.<anonymous> (/Users/aldcroft/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.8/dist/extension.js:2:393166)
    at processImmediate (node:internal/timers:478:21)
2024-07-22 08:00:15.893 [info] [perf] Render performance baseline is 14ms
2024-07-22 08:00:20.213 [error] End of central directory record signature not found. Either not a zip file, or file is truncated.: Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26633)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28076
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)
2024-07-22 08:00:23.709 [error] Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26633)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28076
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)
2024-07-22 08:00:23.720 [error] End of central directory record signature not found. Either not a zip file, or file is truncated.: Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
    at m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:26633)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:48:28076
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:40:7
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:190:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/index.js:712:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/yauzl/fd-slicer.js:33:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:668:5)