microsoft / vscode

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

Extension host stops occasionally #160913

Closed sgarg7 closed 2 years ago

sgarg7 commented 2 years ago

Type: Bug

The issue appears occasionally, probably due to an extension. It's hard to use extension bisect for this because the issue appears after some time. Not sure which of the extensions i have causes this problem. Adding lines from developer tools to help add more info

[Extension Host] vscode
workbench.desktop.main.js:603   ERR [Extension Host] (node:95127) [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 --trace-deprecation ...` to show where the warning was created)
workbench.desktop.main.js:87 [Extension Host] (node:95127) [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 --trace-deprecation ...` to show where the warning was created)
y @ workbench.desktop.main.js:87
workbench.desktop.main.js:87 [Extension Host] Congratulations, your extension "jq-vscode" is now active!
workbench.desktop.main.js:87 [Extension Host] Congratulations, your extension "ckolkman.vscode-postgres" is now active!
workbench.desktop.main.js:87 [Extension Host] Message {0} Toolkit didn't get externalized correctly.
y @ workbench.desktop.main.js:87
workbench.desktop.main.js:603   ERR [Extension Host] fig: Error: Command failed: fig hook keyboard-focus-changed vscode 91949

workbench.desktop.main.js:87 [Extension Host] fig: Error: Command failed: fig hook keyboard-focus-changed vscode 91949

y @ workbench.desktop.main.js:87
workbench.desktop.main.js:2284 Activating extension 'ghmcadams.lintlens' failed: Unable to find ESLint within the open folders' node_modules, make sure you've run `npm install` or `yarn`.
$onExtensionActivationError @ workbench.desktop.main.js:2284
workbench.desktop.main.js:603   ERR A provider has already been registered for scheme file: Error: A provider has already been registered for scheme file
    at k.registerEditSessionIdentityProvider (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2766:14678)
    at g.$registerEditSessionIdentityProvider (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2766:19720)
    at m._doInvokeHandler (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1716:13079)
    at m._invokeHandler (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1716:12761)
    at m._receiveRequest (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1716:11531)
    at m._receiveOneMessage (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1716:10233)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1716:8340
    at S.invoke (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:145)
    at l.deliver (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:2266)
    at a.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:1844)
    at d.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:19365)
    at g._receiveMessage (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:24177)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:21547
    at S.invoke (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:145)
    at l.deliver (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:2266)
    at a.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:83:1844)
    at a.acceptChunk (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:16196)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:15326
    at Socket.E (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:545:27088)
    at Socket.emit (node:events:526:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
3workbench.desktop.main.js:87 [Extension Host] Remapper: verbose: key=<S-tab>. keySlice=<S-tab>.
workbench.desktop.main.js:87 [Extension Host] Remapper: verbose: key=<ExtensionEnable>. keySlice=<ExtensionEnable>.
workbench.desktop.main.js:87 [Extension Host] Remapper: verbose: key=i. keySlice=i.
workbench.desktop.main.js:87 [Extension Host] Message {0} Remote Invocations didn't get externalized correctly.
y @ workbench.desktop.main.js:87
workbench.desktop.main.js:603   ERR Cannot call write after a stream was destroyed: Error: Cannot call write after a stream was destroyed
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at new NodeError (node:internal/errors:371:5)
    at errorBuffer (node:internal/streams/writable:517:14)
    at onwriteError (node:internal/streams/writable:420:3)
    at onwrite (node:internal/streams/writable:457:7)
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:96:12)
workbench.desktop.main.js:3189 Extension host (LocalProcess) terminated unexpectedly. Code: 7, Signal: null
_onExtensionHostCrashed @ workbench.desktop.main.js:3189
workbench.desktop.main.js:603   ERR Extension host (LocalProcess) terminated unexpectedly. No extensions were activated.
workbench.desktop.main.js:810 Extension host terminated unexpectedly 3 times within the last 5 minutes.
onDidChangeNotification @ workbench.desktop.main.js:810
workbench.desktop.main.js:1974 Extension Host
workbench.desktop.main.js:1974 /Users/Shishir.Garg/.vscode/extensions/petli-full.jq-vscode-0.1.3/dist/extension.js:2
DevTools failed to load source map: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/e7f30e38c5a4efafeec8ad52861eb772a9ee4dfb/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout

VS Code version: Code 1.71.1 (e7f30e38c5a4efafeec8ad52861eb772a9ee4dfb, 2022-09-08T19:41:58.611Z) OS version: Darwin arm64 20.6.0 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|3, 3, 2| |Memory (System)|16.00GB (0.11GB free)| |Process Argv|--crash-reporter-id c3c83133-96d0-401f-bce3-febccd10088c| |Screen Reader|no| |VM|0%|
Extensions (78) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.3.1 aws-toolkit-vscode|ama|1.50.0 vscode-apollo|apo|1.19.11 cform|aws|0.0.24 bash-snippets|cas|1.0.0 cloudformation-yaml-validator|cha|0.3.15 path-intellisense|chr|2.8.1 vscode-postgres|cko|1.4.0 format-json|Cle|1.0.2 js-codeformer|cms|2.6.1 elasticsearch-snippets|dan|0.1.2 vscode-jq-playground|dav|4.3.4 vscode-eslint|dba|2.2.6 githistory|don|0.6.19 vscode-generate-getter-setter|DSK|0.5.0 gitlens|eam|12.2.2 permute-lines|ear|1.1.0 whitespace-formatter|eet|0.1.0 json-pretty-printer|eus|1.1.0 vscode-terminals|fab|1.13.0 vscode-logstash-editor|fba|1.3.0 kotlin|fwc|0.2.26 lintlens|ghm|3.0.3 classroom|git|0.0.3 remotehub|Git|0.42.0 vscode-codeql|Git|1.6.12 vscode-pull-request-github|Git|0.51.2022090509 json2ts|Gre|0.0.6 vscode-test-explorer|hbe|2.21.1 align-by-regex|jan|1.0.4 diff-tool|jin|0.0.1 vscode-peacock|joh|4.2.1 jq-syntax-highlighting|jq-|0.0.2 vscode-position|jtr|1.1.2 vscode-jest-test-adapter|kav|0.8.1 vscode-cfn-lint|kdd|0.23.2 vsc-python-indent|Kev|1.17.0 ts-extension-pack|loi|0.3.0 bash-ide-vscode|mad|1.14.0 Kotlin|mat|1.7.1 git-graph|mhu|1.30.0 dotenv|mik|1.0.1 vscode-docker|ms-|1.22.1 csharp|ms-|1.25.0 python|ms-|2022.14.0 vscode-pylance|ms-|2022.9.10 jupyter|ms-|2022.8.1002431955 jupyter-renderers|ms-|1.0.9 remote-containers|ms-|0.251.0 remote-ssh|ms-|0.84.0 remote-ssh-edit|ms-|0.80.0 remote-wsl|ms-|0.66.3 vscode-remote-extensionpack|ms-|0.21.0 live-server|ms-|0.4.1 powershell|ms-|2022.8.5 remote-repositories|ms-|0.20.0 test-adapter-converter|ms-|0.1.6 indent-rainbow|ode|8.3.1 vscode-graphql|ors|0.3.18 jq-vscode|pet|0.1.3 tsimporter|pmn|2.0.1 cf-templates|pra|0.1.1 prisma|Pri|4.3.1 text-power-tools|qcz|1.36.1 typescript-hero|rbb|3.0.0 vscode-yaml|red|1.10.1 vscode-statusbar-json-path|ric|2.0.0 vscode-coverage-gutters|rya|2.10.1 sonarlint-vscode|Son|3.9.0 addDocComments|ste|0.0.8 move-ts|str|1.12.0 errorlens|use|3.6.0 learn-vim|vin|0.0.28 vscode-conventional-commits|viv|1.24.2 vim|vsc|1.23.2 codetour|vsl|0.0.58 gitblame|wad|9.0.1 fig|wit|0.0.6
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411cf:30557515 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vscaat:30438848 pylanb8912:30545647 vsclangdc:30486549 c4g48928:30535728 hb751961:30553087 dsvsc012cf:30540253 azure-dev_surveyone:30548225 i497e931:30553904 fc301958:30567733 ```
alexdima commented 2 years ago

@sgarg7 The log looks incomplete and unfortunately there is nothing actionable. The message Extension host terminated unexpectedly 3 times within the last 5 minutes. is printed after the extension host crashes 3 times. Every time the extension host crashes, it prints a message Extension host (LocalProcess) terminated unexpectedly followed by the list of running extensions. I would have expected to see Extension host (LocalProcess) terminated unexpectedly 3 times, and be able to look at the first crash, which might give clues on what extensions were running when the first crash occurred.

sgarg7 commented 2 years ago

Thanks for the reply. I was wondering if the error just before the extension host crashes is relevant -

workbench.desktop.main.js:603   ERR Cannot call write after a stream was destroyed: Error: Cannot call write after a stream was destroyed
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at new NodeError (node:internal/errors:371:5)
    at errorBuffer (node:internal/streams/writable:517:14)
    at onwriteError (node:internal/streams/writable:420:3)
    at onwrite (node:internal/streams/writable:457:7)
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:96:12)
workbench.desktop.main.js:3189 Extension host (LocalProcess) terminated unexpectedly. Code: 7, Signal: null
_onExtensionHostCrashed @ workbench.desktop.main.js:3189

Does the Code: 7 indicate anything?

alexdima commented 2 years ago

No, unfortunately Code: 7 doesn't point towards anything actionable. Have you encountered this in the meantime? If yes, what is the list of extensions that were activate at the time of the crash?

vscodenpa commented 2 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!