microsoft / vscode

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

add folder to workspace on ssh host crashes the windows client #224565

Open filimonm opened 1 month ago

filimonm commented 1 month ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Connect to an SSH host running Linux
  2. Open a folder
  3. Try to add another folder
  4. The VSCode window freezes and cannot even be closed

https://github.com/user-attachments/assets/2a0cce74-2640-4be8-9e88-1d88e2d8b444

roblourens commented 1 month ago

Could you do

roblourens commented 1 month ago

I do see something a bit odd on mac when trying this, there is a long pause after I try to add the folder, but then the window reloads properly. It seems like we've already shut down the local EH process at this point, but then I bet something is trying to resolve the remote authority (which it can't do without the extension in the local EH process)

I'd bet that if you create the .code-workspace file manually on your remote, you'd be able to open it though.

vijaydhanraj commented 1 month ago

Observe same issue when trying to connect to SSH host running Linux.

Once the frozen VS code window is killed and restarted, can see the workspace folder added but when trying to save the workspace, VS code freezes again. Needs another restart (kill frozen window and start VS code) to finally save the workspace. Ater this can open the saved workspace as usual.

filimonm commented 1 month ago

I see this in the window exthost.log right after choosing the folder to add to the workspace:

2024-08-06 12:20:38.649 [info] Extension host terminating: renderer closed the MessagePort 2024-08-06 12:20:38.651 [trace] ExtHostCommands#executeCommand setContext 2024-08-06 12:20:38.651 [trace] ExtHostCommands#executeCommand _setContext 2024-08-06 12:20:38.658 [error] Canceled: Canceled at new C (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:35204) at E.U (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:6017) at B..j.charCodeAt.R.CharCode.DollarSign.B. (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:3107) at d.g (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205942) at d.executeCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205380) at A.registerCommand.description (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:204704) at d.h (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:206481) at d.g (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205473) at d.executeCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205380) at Object.executeCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:164:23060) at t.shutdown (c:\Users\Filimonm.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.2024072315\out\extension.js:2:585555) at e.deactivate (c:\Users\Filimonm.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.2024072315\out\extension.js:2:854204) at m.eb (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:9856) at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:7927 at Array.map () at m.$ (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:7914) at m.terminate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:8187) at $.terminate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:164:1513) at o (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:10633) at MessagePortMain. (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6825) at MessagePortMain.emit (node:events:519:28) at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285) setContext undefined 2024-08-06 12:20:38.658 [info] Extension host with pid 10224 exiting with code 0

exthost.log

br-maurinn commented 1 month ago

And here are the window logs when adding a folder to workspace

2024-08-05 12:04:31.340 [info] [remote-connection][Management ][1c14f…][reconnect] received socket timeout event (unacknowledgedMsgCount: 2, timeSinceOldestUnacknowledgedMsg: 20003, timeSinceLastReceivedSomeData: 20003). 2024-08-05 12:04:31.341 [info] [remote-connection][Management ][1c14f…][reconnect] starting reconnecting loop. You can get more information with the trace log level. 2024-08-05 12:04:31.342 [info] [remote-connection][Management ][1c14f…][reconnect] resolving connection... 2024-08-05 12:04:31.343 [info] Invoking resolveAuthority(ssh-remote)... 2024-08-05 12:04:31.348 [error] resolveAuthority(ssh-remote) returned an error after 1 ms Cannot resolve authority 2024-08-05 12:04:31.348 [error] [remote-connection][Management ][1c14f…][reconnect] An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error: 2024-08-05 12:04:31.349 [error] Error: Cannot resolve authority at Q.qb (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3233:26944) at Q.Pb (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3235:2756) at Q.pb (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3233:26571) at Q.ob (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3233:26284) at u.value (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3235:4448) at o.B (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:93:732) at o.fire (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:93:949) at Object.getAddress (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2324:25676) at T (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:694:11442) at W.z (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:694:16439) at W.y (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:694:15537) at u.value (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:694:15329) at o.B (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:93:732) at o.fire (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:93:949) at s.fire (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:123:15085) at b.C (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:123:19255) at vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:123:19486 2024-08-05 12:04:31.349 [trace] DialogService#confirm Cannot reconnect. Please reload the window.

jkwashbourne-oss commented 3 weeks ago

Hi, any idea what is going on here? This has been happening to me for months. Previously the "Developer: reload window" would solve the problem but lately I need to kill vscode from task manager and restart. Any suggestions greatly appreciated, and thanks for your time!

aeghnnsw commented 3 weeks ago

I do see something a bit odd on mac when trying this, there is a long pause after I try to add the folder, but then the window reloads properly. It seems like we've already shut down the local EH process at this point, but then I bet something is trying to resolve the remote authority (which it can't do without the extension in the local EH process)

I'd bet that if you create the .code-workspace file manually on your remote, you'd be able to open it though.

I encountered similar issue and tried this, the window can't reload but when opened in a new window, it works. I try to save the workspace in .code-workspace, it will fail to reload and crash, but the file is saved, once opened in a new window, and open the workspace from file, I can add folder to the workspace.