microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.66k stars 286 forks source link

Remote-SSH drops connection after ~1min #6651

Closed bgfritz1 closed 2 years ago

bgfritz1 commented 2 years ago

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:

Version: 1.66.2 (user setup)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19044

The output file looks like this (though I have removed the repeated connectinon attempts):

[13:07:36.330] Log Level: 2
[13:07:36.331] remote-ssh@0.78.0
[13:07:36.331] win32 x64
[13:07:36.338] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a22436f6d70757465726f6d65227d", attempt 1
[13:07:36.338] "remote.SSH.useLocalServer": false
[13:07:36.339] "remote.SSH.showLoginTerminal": false
[13:07:36.339] "remote.SSH.remotePlatform": {"Compute_server":"linux"}
[13:07:36.339] "remote.SSH.path": undefined
[13:07:36.339] "remote.SSH.configFile": undefined
[13:07:36.339] "remote.SSH.useFlock": true
[13:07:36.339] "remote.SSH.lockfilesInTmp": false
[13:07:36.339] "remote.SSH.localServerDownload": auto
[13:07:36.339] "remote.SSH.remoteServerListenOnSocket": false
[13:07:36.340] "remote.SSH.showLoginTerminal": false
[13:07:36.340] "remote.SSH.defaultExtensions": []
[13:07:36.340] "remote.SSH.loglevel": 2
[13:07:36.340] "remote.SSH.enableDynamicForwarding": true
[13:07:36.340] "remote.SSH.enableRemoteCommand": false
[13:07:36.340] "remote.SSH.serverPickPortsFromRange": {}
[13:07:36.340] "remote.SSH.serverInstallPath": {}
[13:07:36.354] SSH Resolver called for host: Compute_server
[13:07:36.354] Setting up SSH remote "Compute_server"
[13:07:36.376] Using commit id "dfd34e8260c270da74b5c2d86d61aee4b6d56977" and quality "stable" for server
[13:07:36.379] Install and start server if needed
[13:07:36.381] Checking ssh with "ssh -V"
[13:07:36.432] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[13:07:36.437] Running script with connection command: ssh -T -D 52974 "Compute_server" bash
[13:07:36.438] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:07:36.653] > ]0;C:\WINDOWS\System32\cmd.exe
[13:07:36.653] Got some output, clearing connection timeout
[13:07:36.783] > #
[13:07:36.794] > #############################################################
> #   Enter your password                                                    #
#########################################################
[13:07:36.824] > Password: 
[13:07:36.824] Showing password prompt
[13:07:41.697] Got password response
[13:07:41.697] "install" wrote data to terminal: "*************"
[13:07:41.714] > 
[13:07:50.900] > 1c758d3924e3: running
[13:07:50.955] > Acquiring lock on /home/people/bgfritz/.vscode-server/bin/dfd34e8260c270da74b5c2
> d86d61aee4b6d56977/vscode-remote-lock.bgfritz.dfd34e8260c270da74b5c2d86d61aee4b6
> d56977
[13:07:50.966] > Installing to /home/people/bgfritz/.vscode-server/bin/dfd34e8260c270da74b5c2d86d
> 61aee4b6d56977...
> 1c758d3924e3%%1%%
> Downloading with wget
[13:07:51.607] > Download complete
> 1c758d3924e3%%2%%
[13:07:51.611] > 
> tar --version:
> tar (GNU tar) 1.26
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.  
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[13:08:02.821] > Checking /home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86d61aee4b6
> d56977.log and /home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86d61
> aee4b6d56977.pid for a running server
[13:08:04.027] > Starting server with command... /home/people/bgfritz/.vscode-server/bin/dfd34e82
> 60c270da74b5c2d86d61aee4b6d56977/bin/code-server --start-server --host=127.0.0.1
>  --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetr
> y-level all   &> "/home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86
> d61aee4b6d56977.log" < /dev/null
> printenv:
>     MANPATH=/cm/local/apps/environment-modules/4.2.1//share/man:/usr/local/man:/
> usr/local/share/man:/usr/share/man/overrides:/usr/share/man:/cm/local/apps/envir
> onment-modules/current/share/man:/opt/thinlinc/share/man
>     XDG_SESSION_ID=764430
>     Tandem=/home/projects/ku_00132
>     SHELL=/bin/bash
[13:08:04.032] > 
>     MODULES_CMD=/cm/local/apps/environment-modules/4.2.1/libexec/modulecmd.tcl  
>     WISECONFIGDIR=/usr/share/wise2/
>     SSH_CLIENT=130.226.236.6 5490 22
>     PERL5LIB=/opt/moab/lib/perl5
>     QTDIR=/usr/lib64/qt-3.3
>     QTINC=/usr/lib64/qt-3.3/include
>     LC_ALL=en_US.utf-8
>     QT_GRAPHICSSYSTEM_CHECKED=1
>     USER=bgfritz
>     ENV=/cm/local/apps/environment-modules/4.2.1//init/profile.sh
>     VSCODE_AGENT_FOLDER=/home/people/bgfritz/.vscode-server
>     PATH=/usr/local/bin:/usr/local/sbin:/usr/lib64/qt-3.3/bin:/cm/local/apps/env
> ironment-modules/4.2.1//bin:/opt/moab/bin:/usr/local/bin:/usr/bin:/sbin:/usr/sbi
> n:/cm/local/apps/environment-modules/4.2.1/bin:/opt/thinlinc/bin
>     MAIL=/var/mail/bgfritz
>     PWD=/home/people/bgfritz
>     LANG=en_US.utf-8
>     MOABHOMEDIR=/opt/moab
>     MODULEPATH=/cm/local/modulefiles:/cm/local/.modulefiles_cache/shared/modulef
> iles
>     KDEDIRS=/usr
>     LOADEDMODULES=
>     project_dir=/home/projects/ku_10025/
>     ENABLE_LMOD=0
>     HOME=/home/people/bgfritz
>     SHLVL=2
>     BASH_ENV=/cm/local/apps/environment-modules/4.2.1//init/bash
>     LOGNAME=bgfritz
>     QTLIB=/usr/lib64/qt-3.3/lib
>     SSH_CONNECTION=130.226.236.6 5490 10.45.15.69 22
>     XDG_DATA_DIRS=/home/people/bgfritz/.local/share/flatpak/exports/share:/var/l
> ib/flatpak/exports/share:/usr/local/share:/usr/share
>     MODULESHOME=/cm/local/apps/environment-modules/4.2.1/
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     XDG_RUNTIME_DIR=/run/user/226647
>     QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
>     BASH_FUNC_module()=() {  unset _mlshdbg;
>      if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then
>      case "$-" in
[13:08:04.061] > 
>      *v*x*)
>      set +vx;
>      _mlshdbg='vx'
>      ;;
>      *v*)
>      set +v;
>      _mlshdbg='v'
>      ;;
>      *x*)
>      set +x;
>      _mlshdbg='x'
>      ;;
>      *)
>      _mlshdbg=''
>      ;;
>      esac;
>      fi;
>      unset _mlre _mlIFS;
>      if [ -n "${IFS+x}" ]; then
>      _mlIFS=$IFS;
>      fi;
>      IFS=' ';
>      for _mlv in ${MODULES_RUN_QUARANTINE:-};
>      do
>      if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]
> ; then
>      if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then
[13:08:04.067] > 
>      _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' ";
>      fi;
>      _mlrv="MODULES_RUNENV_${_mlv}";
>      _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' ";
>      fi;
>      done;
>      if [ -n "${_mlre:-}" ]; then
>      eval `eval ${_mlre}/usr/bin/tclsh /cm/local/apps/environment-modules/4.2.1/
> libexec/modulecmd.tcl bash '"$@"'`;
>      else
>      eval `/usr/bin/tclsh /cm/local/apps/environment-modules/4.2.1/libexec/modul
> ecmd.tcl bash "$@"`;
>      fi;
>      _mlstatus=$?;
>      if [ -n "${_mlIFS+x}" ]; then
>      IFS=$_mlIFS;
>      else
>      unset IFS;
>      fi;
>      unset _mlre _mlv _mlrv _mlIFS;
>      if [ -n "${_mlshdbg:-}" ]; then
>      set -$_mlshdbg;
>      fi;
>      unset _mlshdbg;
>      return $_mlstatus
>     }
>     BASH_FUNC_switchml()=() {  typeset swfound=1;
>      if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
>      typeset swname='main';
>      if [ -e /cm/local/apps/environment-modules/4.2.1//libexec/modulecmd.tcl ]; 
> then
>      typeset swfound=0;
>      unset MODULES_USE_COMPAT_VERSION;
>      fi;
>      else
>      typeset swname='compatibility';
>      if [ -e /cm/local/apps/environment-modules/4.2.1//libexec/modulecmd-compat 
> ]; then
>      typeset swfound=0;
>      MODULES_USE_COMPAT_VERSION=1;
>      export MODULES_USE_COMPAT_VERSION;
>      fi;
>      fi;
>      if [ $swfound -eq 0 ]; then
>      echo "Switching to Modules $swname version";
>      source /cm/local/apps/environment-modules/4.2.1//init/bash;
>      else
>      echo "Cannot switch to Modules $swname version, command not found";        
>      return 1;
>      fi
>     }
>     _=/usr/bin/printenv
>     OLDPWD=/home/people/bgfritz/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61a
> ee4b6d56977
> rm: Spawned remote server: 12376
> Waiting for server log...
> cannot remove ‘/home/people/bgfritz/.vscode-server/.dfd34e8260c270da74b5c2d86d61
> aee4b6d56977.token’: No such file or directory
[13:08:04.074] > Waiting for server log...
[13:08:04.108] > Waiting for server log...
[13:08:04.142] > Waiting for server log...
[13:08:04.176] > Waiting for server log...
[13:08:04.217] >  
> *
> * Reminder: You may only use this software with Visual Studio family products,  
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057) 
> *
> 
> 1c758d3924e3: start
> SSH_AUTH_SOCK====
> DISPLAY====
[13:08:04.223] > 
> webUiAccessToken====
> listeningOn==36804==
> osReleaseId==centos==
> arch==x86_64==
> tmpDir==/run/user/226647==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==649==
> installTime==11172==
> extInstallTime====
> serverStartTime==187==
> connectionToken==11aa1a11-a11a-1a11-1111-11a11aaa11aa==
> 1c758d3924e3: end
[13:08:04.223] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==36804==
osReleaseId==centos==
arch==x86_64==
tmpDir==/run/user/226647==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==649==
installTime==11172==
extInstallTime====
serverStartTime==187==
connectionToken==11aa1a11-a11a-1a11-1111-11a11aaa11aa==

[13:08:04.224] Remote server is listening on 36804
[13:08:04.224] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":36804},"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/226647","platform":"linux","connectionToken":"11aa1a11-a11a-1a11-1111-11a11aaa11aa"},"downloadTime":649,"installTime":11172,"serverStartTime":187,"installUnpackCode":"success"}
[13:08:04.228] Starting forwarding server. localPort 52979 -> socksPort 52974 -> remotePort 36804
[13:08:04.229] Forwarding server listening on 52979
[13:08:04.230] Waiting for ssh tunnel to be ready
[13:08:04.231] > 
[13:08:04.232] [Forwarding server 52979] Got connection 0
[13:08:04.233] Tunneled 36804 to local port 52979
[13:08:04.233] Resolved "ssh-remote+7b22686f73744e616d65223a22436f6d70757465726f6d65227d" to "127.0.0.1:52979"
[13:08:04.245] ------

[13:08:04.269] [Forwarding server 52979] Got connection 1
[13:08:04.427] [Forwarding server 52979] Got connection 2
[13:08:31.095] > bash: line 622: 12451 Killed                  sleep 180
[13:08:31.173] ------

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: enabled
canvas_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 ```
tanhakabir commented 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?

bgfritz1 commented 2 years ago

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
tanhakabir commented 2 years ago

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

maximilian-schwaerzler commented 2 years ago

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

bgfritz1 commented 2 years ago

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.

bgfritz1 commented 2 years ago

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.