Closed bgfritz1 closed 2 years ago
This seems similar to https://github.com/microsoft/vscode/issues/147328
What happens if you set remote.SSH.useLocalServer: true
in your settings?
Hi @tanhakabir, thanks for the suggestion!
When I went into the settings, the box for useLocalServer
was checked, but apparently this was ignored, since it says
[13:07:36.338] "remote.SSH.useLocalServer": false
in the output I posted above... Maybe another bug?
Anyways, I went into my settings.json and added your suggestion. My settings.json now looks like:
{
"window.zoomLevel": -1,
"remote.SSH.remotePlatform": {
"Compute_server": "linux"
},
"remote.SSH.useLocalServer": true
}
I tried to reconnect with remote-SSH. I was able to connect but, similar to before, the connection was dropped quite soon after.
[21:49:12.431] Log Level: 2
[21:49:12.432] remote-ssh@0.78.0
[21:49:12.433] win32 x64
[21:49:12.464] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a22436f6d707574655f736572766572227d", attempt 1
[21:49:12.465] "remote.SSH.useLocalServer": true
[21:49:12.465] "remote.SSH.path": undefined
[21:49:12.466] "remote.SSH.configFile": undefined
[21:49:12.466] "remote.SSH.useFlock": true
[21:49:12.466] "remote.SSH.lockfilesInTmp": false
[21:49:12.466] "remote.SSH.localServerDownload": auto
[21:49:12.466] "remote.SSH.remoteServerListenOnSocket": false
[21:49:12.466] "remote.SSH.showLoginTerminal": false
[21:49:12.466] "remote.SSH.defaultExtensions": []
[21:49:12.466] "remote.SSH.loglevel": 2
[21:49:12.466] "remote.SSH.enableDynamicForwarding": true
[21:49:12.467] "remote.SSH.enableRemoteCommand": false
[21:49:12.467] "remote.SSH.serverPickPortsFromRange": {}
[21:49:12.467] "remote.SSH.serverInstallPath": {}
[21:49:12.471] SSH Resolver called for host: Compute_server
[21:49:12.472] Setting up SSH remote "Compute_server"
[21:49:12.476] Acquiring local install lock: C:\Users\wmc740\AppData\Local\Temp\vscode-remote-ssh-3c1ab654-install.lock
[21:49:12.511] Looking for existing server data file at c:\Users\wmc740\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-3c1ab654-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0\data.json
[21:49:12.511] Using commit id "dfd34e8260c270da74b5c2d86d61aee4b6d56977" and quality "stable" for server
[21:49:12.518] Install and start server if needed
[21:49:12.521] Checking ssh with "ssh -V"
[21:49:12.572] > OpenSSH_for_Windows_8.1p1,
[21:49:12.572] > LibreSSL 3.0.2
[21:49:12.575] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[21:49:12.615] > OpenSSH_for_Windows_8.1p1,
[21:49:12.616] > LibreSSL 3.0.2
[21:49:12.618] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[21:49:12.619] Got error from ssh: spawn C:\Program Files\Git\usr\bin\ssh.exe ENOENT
[21:49:12.619] Checking ssh with "C:\Program Files (x86)\Git\usr\bin\ssh.exe -V"
[21:49:12.621] Got error from ssh: spawn C:\Program Files (x86)\Git\usr\bin\ssh.exe ENOENT
[21:49:12.621] Checking ssh with "ssh -V"
[21:49:12.666] > OpenSSH_for_Windows_8.1p
[21:49:12.666] > 1, LibreSSL 3.0.2
[21:49:12.670] Using SSH config file "C:\Users\wmc740\.ssh\config"
[21:49:12.671] askpass server listening on \\.\pipe\vscode-ssh-askpass-350530625705a131c134af885b2c27c800baa223-sock
[21:49:12.671] Spawning local server with {"serverId":1,"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-cf6db0a0b20f201e5b8a88f1d40eeaabfa7dfe38-sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","60022","-F","C:\\Users\\wmc740\\.ssh\\config","Compute_server","bash"],"serverDataFolderName":".vscode-server","dataFilePath":"c:\\Users\\wmc740\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-3c1ab654-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0\\data.json"}
[21:49:12.671] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\wmc740\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.78.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Users\\wmc740\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\wmc740\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.78.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-350530625705a131c134af885b2c27c800baa223-sock"}
[21:49:12.682] Spawned 13056
[21:49:12.785] > local-server-1> Spawned ssh, pid=14224
[21:49:12.850] stderr> OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[21:49:12.967] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:wfat2P0+m5b20oIxaQtBa5pthWIgM6+bTW7jonTBqIQ
[21:49:13.076] stderr> ####################################
[21:49:13.077] stderr> #########################
[21:49:13.077] stderr> # #
[21:49:13.078] stderr> # Welcome to
[21:49:13.079] stderr> #Compute_server #
[21:49:13.086] stderr> #############################################################
[21:49:13.254] Got askpass request: {"request":"Password: "}
[21:49:13.254] Showing password prompt
[21:49:13.255] Listening for interwindow password on \\.\pipe\vscode-ssh-askpass-fc05af2c67a87966abd3ec9158b7b45d2a47152b-sock
[21:49:13.256] Writing password prompt to globalState
[21:49:16.510] Got password response
[21:49:16.510] Interactor gave response: *************
[21:49:16.510] Cleaning up other-window auth server
[21:49:20.695] stderr> Authenticated to ssh.computerome.dk ([130.226.25.10]:22).
[21:49:20.907] > ready: 01c87d326ebd
[21:49:20.929] > Linux 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019
[21:49:20.930] Platform: linux
[21:49:20.948] > /bin/bash
[21:49:20.949] Shell: bash
[21:49:20.949] Creating bash subshell inside "bash"
[21:49:20.989] > bash version: 4.2.46(2)-release
[21:49:21.020] > 01c87d326ebd: running
[21:49:21.069] > Acquiring lock on /home/people/bgfritz/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/vscode-remote-lock.bgfritz.dfd34e8260c270da74b5c2d86d61aee4b6d56977
[21:49:21.071] > Found existing installation at /home/people/bgfritz/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977...
> Checking /home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86d61aee4b6d56977.log and /home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86d61aee4b6d56977.pid for a running server
[21:49:21.074] > Looking for server with pid: 14644
[21:49:21.174] > Found running server...
[21:49:21.174] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
[21:49:21.182] > Checking server status on port 42117 with wget
[21:49:21.190] > 01c87d326ebd: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==42117==
> osReleaseId==centos==
> arch==x86_64==
> tmpDir==/run/user/226647==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==aa1111aa-11aa-1111-1a1a-1a11111a1a11==
> 01c87d326ebd: end
[21:49:21.190] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==42117==
osReleaseId==centos==
arch==x86_64==
tmpDir==/run/user/226647==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==aa1111aa-11aa-1111-1a1a-1a11111a1a11==
[21:49:21.191] Remote server is listening on 42117
[21:49:21.191] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":42117},"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/226647","platform":"linux","connectionToken":"aa1111aa-11aa-1111-1a1a-1a11111a1a11"},"installUnpackCode":""}
[21:49:21.192] Persisting server connection details to c:\Users\wmc740\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-3c1ab654-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0\data.json
[21:49:21.197] Starting forwarding server. localPort 57718 -> socksPort 60022 -> remotePort 42117
[21:49:21.197] Forwarding server listening on 57718
[21:49:21.197] Waiting for ssh tunnel to be ready
[21:49:21.198] [Forwarding server 57718] Got connection 0
[21:49:21.199] Tunneled 42117 to local port 57718
[21:49:21.199] Resolved "ssh-remote+7b22686f73744e616d65223a22436f6d707574655f736572766572227d" to "127.0.0.1:57718"
[21:49:21.211] ------
[21:49:21.267] [Forwarding server 57718] Got connection 1
[21:49:21.323] [Forwarding server 57718] Got connection 2
[21:49:29.754] ------
[21:49:29.754] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a22436f6d707574655f736572766572227d", attempt 2, (Reconnection)
[21:49:29.756] SSH Resolver called for host: Compute_server
[21:49:29.756] Setting up SSH remote "Compute_server"
[21:49:29.758] Acquiring local install lock: C:\Users\wmc740\AppData\Local\Temp\vscode-remote-ssh-3c1ab654-install.lock
[21:49:29.759] Looking for existing server data file at c:\Users\wmc740\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-3c1ab654-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0\data.json
[21:49:29.760] Found local server running: {"remoteListeningOn":{"port":42117},"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/226647","platform":"linux","connectionToken":"aa1111aa-11aa-1111-1a1a-1a11111a1a11","pid":13056,"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-cf6db0a0b20f201e5b8a88f1d40eeaabfa7dfe38-sock","socksPort":60022,"startupTime":1651088952682}
[21:49:29.760] Running server is stale. Ignoring
[21:49:29.761] Using commit id "dfd34e8260c270da74b5c2d86d61aee4b6d56977" and quality "stable" for server
[21:49:29.763] Install and start server if needed
[21:49:29.772] Using SSH config file "C:\Users\wmc740\.ssh\config"
[21:49:29.773] askpass server listening on \\.\pipe\vscode-ssh-askpass-dc2fc7fbdbe25ee59d751e07ac737e888f520b4b-sock
[21:49:29.774] Spawning local server with {"serverId":2,"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-9c45bf291fbd3e6142e3281b5351cf9be0e92068-sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","55855","-F","C:\\Users\\wmc740\\.ssh\\config","Compute_server","bash"],"serverDataFolderName":".vscode-server","dataFilePath":"c:\\Users\\wmc740\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-3c1ab654-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0\\data.json"}
[21:49:29.774] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\wmc740\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.78.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Users\\wmc740\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\wmc740\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.78.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-dc2fc7fbdbe25ee59d751e07ac737e888f520b4b-sock"}
[21:49:29.787] Spawned 7528
[21:49:29.983] > local-server-2> Spawned ssh, pid=368
[21:49:30.086] stderr> OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[21:49:30.211] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:wfat2P0+m5b20oIxaQtBa5pthWIgM6+bTW7jonTBqIQ
[21:49:30.313] stderr> ######################
[21:49:30.314] stderr> #######################################
[21:49:30.314] stderr> # #
[21:49:30.314] stderr> # Welcome to Computer_server #
[21:49:30.314] stderr> # #
[21:49:30.317] stderr> #############################################################
[21:49:30.479] Got askpass request: {"request":"Password: "}
[21:49:30.479] Showing password prompt
[21:49:30.480] Listening for interwindow password on \\.\pipe\vscode-ssh-askpass-4096a4b4d4da993d00babdb613949571370b7e27-sock
[21:49:30.480] Writing password prompt to globalState
[21:49:34.255] > local-server-1> Timed out
[21:49:34.267] Local server exit: 0
Hm based on this I'm very suspicious that this is a duplicate of https://github.com/microsoft/vscode/issues/147328.
I'll keep this issue open for now but I think once that issue is solved so will your issue
Same thing happens to me when SSH on my Raspberry Pi, only that it works for about 5 Minutes and then tries to reconnect. After about 1 hour, it tries to reconnect but doesn't succeed. Also normal SSH is blocked from then on. Because I also have a server running on Port 80, which also seizes to work, I can say pretty confidently that there is a bigger issue than only VS Code
Some more info regarding this issue - I did some troubleshooting, where I made an AWS instance of Ubuntu 22.04 LTS. I was then able to connect via remote-ssh via password authentication and the connection didn't drop. So, I think the issue is likely a problem with the configuration of the SSH host server not playing nicely with Remote-SSH.
Hi again all,
I learned that the issue was not with VScode but rather the ssh server killing the connection due to too many running processes.
Closing this issue.
Issue Type: Performance Issue
Recently it seems that remote-ssh has not been able to keep a connection to my ssh server. I am able to establish a connection and see and edit files/directories in vscode but, after a minute or so, the connection is dropped and I am asked for my password. I can continue logging in, but the same thing is repeated.
It seems to me that bash kills the connection, because after the connection is established, I can see:
> bash: line 622: 12451 Killed sleep 180
I have previously used vs-code with remote-ssh without problems to connect to the same server, but I feel the problem has arisen over the last couple of months.
I am running the following version of vscode:
The output file looks like this (though I have removed the repeated connectinon attempts):
Extension version: 0.78.0 VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:46:01.075Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz (12 x 2592)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
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| |Load (avg)|undefined| |Memory (System)|31.71GB (23.35GB free)| |Process Argv|-n --crash-reporter-id 45dd2ec8-893e-4185-a35e-71d2a116f6a7| |Screen Reader|no| |VM|0%|
Process Info
``` CPU % Mem MB PID Process 1 106 15868 code main 0 88 380 issue-reporter 0 105 3084 gpu-process 0 120 9788 shared-process 0 81 18848 fileWatcher 0 88 25580 ptyHost 0 6 2136 console-window-host (Windows internal process) 0 6 4884 console-window-host (Windows internal process) 0 4 7984 C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\wmc740\AppData\Local\Temp\vscode-linux-multi-line-command--ompute_server-596658221.sh" | ssh -T -D 53177 "Compute_server" bash) & exit /b 0 0 9 16944 ssh -T -D 53177 "Compute_server" bash 0 4 9704 C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\wmc740\AppData\Local\Temp\vscode-linux-multi-line-command--ompute_server-434140144.sh" | ssh -T -D 53106 "Compute_server" bash) & exit /b 0 0 9 18840 ssh -T -D 53106 "Compute_server" bash 0 6 9872 console-window-host (Windows internal process) 0 4 10464 C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\wmc740\AppData\Local\Temp\vscode-linux-multi-line-command--ompute_server-212631341.sh" | ssh -T -D 53231 "Compute_server" bash) & exit /b 0 0 9 21216 ssh -T -D 53231 "Compute_server" bash 0 6 19072 console-window-host (Windows internal process) 0 4 22408 C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\wmc740\AppData\Local\Temp\vscode-linux-multi-line-command--ompute_server-644722348.sh" | ssh -T -D 53198 "Compute_server" bash) & exit /b 0 0 9 10696 ssh -T -D 53198 "Compute_server" bash 0 121 13564 extensionHost 0 39 20268 utility-network-service 0 234 20692 window (Get Started - Visual Studio Code) 0 26 22472 crashpad-handler ```Workspace Info
``` ; ```A/B Experiments
``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30443607 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 pythonvsnew555:30457759 vscscmwlcmt:30465135 cppdebugcf:30475217 ```