microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
99.37k stars 12.31k forks source link

typescript-language-features remote ssh crash #59139

Open vaughnskinner opened 2 months ago

vaughnskinner commented 2 months ago

Type: Bug

This was an annoyingly difficult issue to track down as due to the builtin typescript-language-features. I do NOT need to have this fixed as I can disable the extension. It would be nice to have fixed so I can run the stock builtin extensions. Posting here in case someone else has similar issue. They might be able to see a pattern with mine.

Reproducing

Wait a few seconds. Get notification of: Remote Extension host terminated unexpectedly 3 times within the last 5 minutes.

If I disable the buildin extension typescript-language-features then it loads with no issues.

Log message in Output - Server has:

2024-05-04 13:11:43.726 [info] Last EH closed, waiting before shutting down
2024-05-04 13:12:03.761 [error] [<unknown>][ea8b9349][ExtensionHostConnection] Unknown reconnection token (seen before).
2024-05-04 13:12:03.853 [info] [<unknown>][5eb9842f][ExtensionHostConnection] New connection established.
2024-05-04 13:12:03.863 [info] [<unknown>][5eb9842f][ExtensionHostConnection] <111457> Launched Extension Host Process.
2024-05-04 13:12:04.710 [info] [<unknown>][5eb9842f][ExtensionHostConnection] <111457> Extension Host Process exited with code: null, signal: SIGSEGV.
2024-05-04 13:12:04.711 [info] Cancelling previous shutdown timeout
2024-05-04 13:12:04.711 [info] Last EH closed, waiting before shutting down

I turned on typescript logfile with the following setting in settings.json:

 "typescript.tsserver.log": "verbose"

I will attach a tsserver logfile from this. There is an exception there about executing command and message about "Error: write EPIPE"

I have tried both vscode version 1.89.0 and code - insiders. The vscode works okay in Remote SSH to other ubuntu servers. Just this docker instance has an issue. Remote (1and1 hosted) and local (docker hosted) installed similarly with ansible install scripts. There could be differences due to 1and1 hosted image vs docker initial image. (?)

I have tried disabling all extensions (Except Remote ssh).

VS Code version: Code - Insiders 1.90.0-insider (Universal) (816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f, 2024-05-03T17:56:40.522Z) OS version: Darwin x64 23.4.0 Modes: Remote OS version: Linux x64 6.6.22-linuxkit

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz (8 x 2300)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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)|3, 4, 4| |Memory (System)|32.00GB (0.08GB free)| |Process Argv|--crash-reporter-id 10fe963a-6fd1-43cd-bb5d-2c14a220c1b1| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: dev.docu.team| |OS|Linux x64 6.6.22-linuxkit| |CPUs|Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz (8 x 2304)| |Memory (System)|7.66GB (4.80GB free)| |VM|0%|
Extensions (3) Extension|Author (truncated)|Version ---|---|--- remote-ssh|ms-|0.112.2024042515 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.5.2024031109
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vsc_aacf:30263846 vscod805:30301674 vsaa593:30376534 py29gd2263:31024238 c4g48928:30535728 a9j8j154:30646983 962ge761:30841072 pythongtdpath:30726887 welcomedialog:30812478 pythonidxpt:30768918 pythonnoceb:30776497 asynctok:30898717 dsvsc013:30777762 dsvsc014:30777825 dsvsc015:30821418 pythontestfixt:30866404 pythonregdiag2:30926734 pyreplss1:30879911 pythonmypyd1:30859725 pythoncet0:30859736 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 cppperfnew:30980852 ccp2r3:30958153 pythonait:30973460 showvideot:31016890 chatpanelt:31014475 724cj586:31013169 pythoncenvpt:31022790 a69g1124:31018687 j0bi8933:31021562 dvdeprecationcf:31036533 pythonprt:31036556 dwnewjupytercf:31035177 ```
vaughnskinner commented 2 months ago

tsserver.log

Exception report is on line 239.

mjbvz commented 3 weeks ago

@sheetalkamat Any ideas what would cause this exception:

Info 40   [13:04:59.294] TIAdapter:: Scheduling request for: /home/ectown/t1/jsconfig.json
Info 41   [13:04:59.295] event:
    {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/home/ectown/t1/jsconfig.json"}}
Info 42   [13:04:59.298] event:
    {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"fd8df32e40d854c1593aaf349b9ba040a6cda4e77181d5febce07669c49557dd","fileStats":{"js":1,"jsSize":18,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":18,"dtsSize":1656617,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"module":"commonjs","target":"es6"},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":true,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"5.4.5"}}}
Info 43   [13:04:59.299] event:
    {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/home/ectown/t1/z.js","configFile":"/home/ectown/t1/jsconfig.json","diagnostics":[]}}
Info 44   [13:04:59.300] Project '/home/ectown/t1/jsconfig.json' (Configured)
Info 44   [13:04:59.300]    Files (19)

Info 44   [13:04:59.300] -----------------------------------------------
Info 44   [13:04:59.300] Open files: 
Info 44   [13:04:59.300]    FileName: /home/ectown/t1/z.js ProjectRootPath: /home/ectown/t1
Info 44   [13:04:59.300]        Projects: /home/ectown/t1/jsconfig.json
Perf 44   [13:04:59.300] 2::updateOpen: elapsed time (in milliseconds) 986.2554
Info 45   [13:04:59.301] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":2,"success":true,"performanceData":{"updateGraphDurationMs":936.4607949852943},"body":true}
Err 46    [13:04:59.319] Exception on executing command unknown:

    write EPIPE

    Error: write EPIPE
        at target._send (node:internal/child_process:872:20)
        at target.send (node:internal/child_process:745:19)
        at IpcIOSession.writeMessage (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:189210:15)
        at IpcIOSession.send (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:185763:10)
        at IpcIOSession.event (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:185772:10)
        at IpcIOSession.event (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:189180:15)
        at IpcIOSession.defaultEventHandler (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:185654:14)
        at _ProjectService.eventHandler (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:185557:83)
        at getOrCreateFileWatcher (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:181149:15)
        at Object.watchDirectory (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:181125:12)
        at watchDirectory (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:121585:67)
        at Object.watchDirectory (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:121653:92)
        at createDirectoryWatcherWithLogging (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:121638:44)
        at Object.watchDirectory (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:121603:283)
        at ConfiguredProject2.watchTypeRootsDirectory (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:178911:45)
        at createTypeRootsWatch (/home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:128548:60)
        at /home/ectown/.vscode-server-insiders/cli/servers/Insiders-816c6f7d7bc4da9796cd19ac6b122b6e26f50d7f/server/extensions/node_modules/typescript/lib/tsserver.js:20160:21
        at Set.forEach (<anonymous>)

We've seen a few reports of folks hitting EPIPE, typically on linux or windows

sheetalkamat commented 2 weeks ago

EPIPE is generally when the other end is disconnected. Looking from stack i cant see why? IT seems like new project is being created or updated and we are sending event to watch a directory. Having tsserver.log would be useful to look into this.