microsoft / microsoft/vscode-remote-release

[Remote-SSH Bug]: Warning about 5 active terminal sessions that do not exist upon exit

Open
#10,505 9 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Is there an existing issue for this bug?
  • I have searched the existing issues
Required Troubleshooting Steps
  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting (more info here)
Connect Locally

It connects successfully

->

Whenever I try to close a VSCode window with an active remote SSH connection, I receive the warning:

Do you want to terminate the 5 active terminal sessions?

Even if I don't have any terminal sessions open. If I actually have created terminal sessions myself, the number will increase as expected.

This bug is also reported here, but the converation is closed: https://github.com/microsoft/vscode-remote-release/issues/10322, and mentioned here on SO without any comments: https://stackoverflow.com/questions/78989589/vscode-warns-about-active-terminal-sessions-that-do-not-exist

I have verified that the problem persists if I disable all other extensions and also if I kill the remote VSCode server and try again. The remote.SSH.useLocalServer setting makes no difference.

I have not yet been able to verify if the behaviour is specific to the server I am connecting to.

The only other remoteSSH settings I have in my config file are a custom install path (remote.SSH.serverInstallPath) and

"remote.SSH.remotePlatform": {
    "calcua": "linux"
  },
  "remote.autoForwardPortsSource": "hybrid",
Expected Behavior

I expect there to be no warnings about closing active terminal sessions if there aren't any.

Steps To Reproduce
  1. Connect to remote SSH server (linux-based HPC).
  2. Close window
  3. Receive warning about active terminal sessions.
Remote-SSH Log
Remote-SSH Log

[10:25:23.121] Log Level: 2
[10:25:23.128] VS Code version: 1.95.3
[10:25:23.128] Remote-SSH version: remote-ssh@0.115.1
[10:25:23.128] win32 x64
[10:25:23.131] SSH Resolver called for "ssh-remote+calcua", attempt 1
[10:25:23.131] "remote.SSH.useLocalServer": false
[10:25:23.132] "remote.SSH.useExecServer": true
[10:25:23.132] "remote.SSH.showLoginTerminal": false
[10:25:23.132] "remote.SSH.remotePlatform": {"calcua":"linux"}
[10:25:23.132] "remote.SSH.path": undefined
[10:25:23.132] "remote.SSH.configFile": undefined
[10:25:23.132] "remote.SSH.useFlock": true
[10:25:23.132] "remote.SSH.lockfilesInTmp": false
[10:25:23.132] "remote.SSH.localServerDownload": auto
[10:25:23.132] "remote.SSH.remoteServerListenOnSocket": false
[10:25:23.132] "remote.SSH.showLoginTerminal": false
[10:25:23.132] "remote.SSH.defaultExtensions": []
[10:25:23.133] "remote.SSH.loglevel": 2
[10:25:23.133] "remote.SSH.enableDynamicForwarding": true
[10:25:23.133] "remote.SSH.enableRemoteCommand": false
[10:25:23.133] "remote.SSH.serverPickPortsFromRange": {}
[10:25:23.134] "remote.SSH.serverInstallPath": {"calcua":"/data/antwerpen/###/########/"}
[10:25:23.134] "remote.SSH.permitPtyAllocation": false
[10:25:23.134] "remote.SSH.preferredLocalPortRange: undefined
[10:25:23.134] "remote.SSH.useCurlAndWgetConfigurationFiles: false
[10:25:23.144] SSH Resolver called for host: calcua
[10:25:23.144] Setting up SSH remote "calcua"
[10:25:23.156] Using commit id "f1a4fb101478ce6ec82fe9627c43efbf9e98c813" and quality "stable" for server
[10:25:23.163] Script variables:
 {
  "InstallExitCode.24": "AlreadyInProgress",
  "InstallExitCode.25": "ServerDownloadFailed",
  "InstallExitCode.26": "NoDownloaderAvailable",
  "InstallExitCode.27": "UnsupportedArch",
  "InstallExitCode.28": "StatusCheckFailed",
  "InstallExitCode.29": "NeedInsidersArch",
  "InstallExitCode.30": "NoDownloaderAvailableForStatusCheck",
  "InstallExitCode.31": "ServerTransferFailed",
  "InstallExitCode.32": "ServerFailedToStart",
  "InstallExitCode.33": "NeedInsidersWindows",
  "InstallExitCode.34": "CreateInstallDirFailed",
  "InstallExitCode.35": "UnsupportedPlatform",
  "InstallExitCode.36": "ServerTerminatedCVE20201416",
  "InstallExitCode.37": "UnpackFailed",
  "InstallExitCode.38": "ChangeDirFailed",
  "InstallExitCode.AlreadyInProgress": "24",
  "InstallExitCode.ServerDownloadFailed": "25",
  "InstallExitCode.NoDownloaderAvailable": "26",
  "InstallExitCode.NoDownloaderAvailableForStatusCheck": "30",
  "InstallExitCode.UnsupportedArch": "27",
  "InstallExitCode.StatusCheckFailed": "28",
  "InstallExitCode.NeedInsidersArch": "29",
  "InstallExitCode.ServerTransferFailed": "31",
  "InstallExitCode.ServerFailedToStart": "32",
  "InstallExitCode.NeedInsidersWindows": "33",
  "InstallExitCode.CreateInstallDirFailed": "34",
  "InstallExitCode.UnsupportedPlatform": "35",
  "InstallExitCode.ServerTerminatedCVE20201416": "36",
  "InstallExitCode.UnpackFailed": "37",
  "InstallExitCode.ChangeDirFailed": "38",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "6de0252f7c23",
  "startMarker": "6de0252f7c23: running",
  "commitId": "f1a4fb101478ce6ec82fe9627c43efbf9e98c813",
  "quality": "stable",
  "token": "a11a1aaa-1111-1aa1-1a1a-a1a11a1a111a",
  "vscodeAgentFolder": "/data/antwerpen/###/########//.vscode-server",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-host=127.0.0.1 --on-port",
  "getDownloadServerStartTrigger": "6de0252f7c23:trigger_server_download",
  "getDownloadServerEndTrigger": "6de0252f7c23:trigger_server_download_end",
  "getProgressDownloading": "6de0252f7c23%%1%%",
  "getProgressInstalling": "6de0252f7c23%%2%%"
}
[10:25:23.165] Install and start server if needed
[10:25:23.169] Checking ssh with "C:\Program Files\Quarto\bin\ssh.exe -V"
[10:25:23.176] Got error from ssh: spawn C:\Program Files\Quarto\bin\ssh.exe ENOENT
[10:25:23.177] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V"
[10:25:23.179] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[10:25:23.179] Checking ssh with "C:\windows\system32\ssh.exe -V"
[10:25:23.181] Got error from ssh: spawn C:\windows\system32\ssh.exe ENOENT
[10:25:23.182] Checking ssh with "C:\windows\ssh.exe -V"
[10:25:23.183] Got error from ssh: spawn C:\windows\ssh.exe ENOENT
[10:25:23.184] Checking ssh with "C:\windows\System32\Wbem\ssh.exe -V"
[10:25:23.187] Got error from ssh: spawn C:\windows\System32\Wbem\ssh.exe ENOENT
[10:25:23.187] Checking ssh with "C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:25:23.189] Got error from ssh: spawn C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:25:23.189] Checking ssh with "C:\windows\System32\OpenSSH\ssh.exe -V"
[10:25:23.263] > OpenSSH_for_Windows_8.1p1, 
[10:25:23.263] > LibreSSL 3.0.2

[10:25:23.270] Running script with connection command: "C:\windows\System32\OpenSSH\ssh.exe" -T -D 59929 calcua sh
[10:25:23.272] Generated SSH command: 'type "C:\Users\pmoris\AppData\Local\Temp\vscode-linux-multi-line-command-calcua-677146999.sh" | "C:\windows\System32\OpenSSH\ssh.exe" -T -D 59929 calcua sh'
[10:25:23.273] Using connect timeout of 17 seconds
[10:25:23.274] Terminal shell path: C:\windows\System32\cmd.exe
[10:25:23.930] > ]0;C:\windows\System32\cmd.exe
[10:25:23.930] Got some output, clearing connection timeout
[10:25:24.051] > Enter passphrase for key 'C:\Users\pmoris/.ssh/id_ed25519': 
[10:25:24.051] Detected passphrase message
[10:25:36.542] Got passphrase response
[10:25:36.542] "install" wrote data to terminal: "***********"
[10:25:36.580] > 
[10:25:37.495] > 6de0252f7c23: running
> Script executing under PID: 4038010
[10:25:37.502] > Found existing installation at /data/antwerpen/###/########//.vscode-server...
> Starting VS Code CLI...
> printenv:
>     CONDA_SHLVL=1
>     CONDA_EXE=/data/antwerpen/###/########/miniforge3/bin/conda
>     LMOD_FAMILY_CALCUA=calcua
>     VSC_VO=gvo00017
>     _ModuleTable002_=bnR3ZXJwZW4vbW9kdWxlcy9yb2NreTgvc29mdHdhcmUtYnJvYWR3ZWxsLzI
> wMjRhL2FsbCIKLCAiL2FwcHMvYW50d2VycGVuL21vZHVsZXMvcm9ja3k4L3NvZnR3YXJlLWJyb2Fkd2V
> sbC8yMDIzYS9hbGwiCiwgIi9hcHBzL2FudHdlcnBlbi9tb2R1bGVzL3JvY2t5OC9zb2Z0d2FyZS1icm9
> hZHdlbGwvMjAyMmEvYWxsIgosICIvYXBwcy9hbnR3ZXJwZW4vbW9kdWxlcy9yb2NreTgvc29mdHdhcmU
> tYnJvYWR3ZWxsLzIwMjFhL2FsbCIKLCAiL2FwcHMvYW50d2VycGVuL21vZHVsZXMvY2VudG9zOC9zb2Z
> 0d2FyZS1icm9hZHdlbGwvMjAyMGEiCiwgIi9hcHBzL2FudHdlcnBlbi9tb2R1bGVzL3JvY2t5OC9zb2Z
> 0d2FyZS1icm9hZHdlbGwvc3lzdGVtL2FsbCIKLCAiL2FwcHMvYW50
>     SSH_CONNECTION=#############################################
>     VSC_INSTITUTE=antwerpen
>     LANG=en_US.UTF-8
>     VSC_SCRATCH=/scratch/antwerpen/###/########
>     CONDA_PREFIX=/data/antwerpen/###/########/miniforge3
>     S_COLORS=auto
>     VSC_INSTITUTE_CLUSTER=leibniz
>     _CE_M=
>     which_declare=declare -f
>     XDG_SESSION_ID=c1258735
>     USER=vsc20380
>     VSC_SCRATCH_GLOBAL=/scratch/antwerpen/###/########
>     VSC_SCRATCH_NODE=/tmp
>     __LMOD_REF_COUNT_MODULEPATH=/apps/antwerpen/modules/rocky8/software-broadwel
> l/2024a/all:1;/apps/antwerpen/modules/rocky8/software-broadwell/2023a/all:1;/app
> s/antwerpen/modules/rocky8/software-broadwell/2022a/all:1;/apps/antwerpen/module
> s/rocky8/software-broadwell/2021a/all:1;/apps/antwerpen/modules/centos8/software
> -broadwell/2020a:1;/apps/antwerpen/modules/rocky8/software-broadwell/system/all:
> 1;/apps/antwerpen/modules/centos8/software-broadwell/system:1;/apps/antwerpen/mo
> dules/rocky8/software-x86_64/all:1;/apps/antwerpen/modules/centos8/software-x86_
> 64:1;/apps/antwerpen/modules/rocky8/calcua-broadwell:1
>     PWD=/user/antwerpen/###/########
>     CALCUA_FAMILY_CALCUA_VERSION=all
>     HOME=/user/antwerpen/###/########
>     CONDA_PYTHON_EXE=/data/antwerpen/###/########/miniforge3/bin/python
>     SSH_CLIENT=193.190.239.10 1828 22
>     LMOD_VERSION=8.7.32
>     VSC_ARCH_SUFFIX=
>     LMOD_PAGER=none
>     BASH_ENV=/usr/share/lmod/lmod/init/bash
>     _CE_CONDA=
>     LMOD_FAMILY_CALCUA_VERSION=all
>     NXF_APPTAINER_CACHEDIR=/scratch/antwerpen/###/########/apptainer/nextflow_ca
> che
>     VSC_OS_LOCAL=rocky8
>     LMOD_sys=Linux
>     _ModuleTable001_=X01vZHVsZVRhYmxlXyA9IHsKTVR2ZXJzaW9uID0gMywKY19yZWJ1aWxkVGl
> tZSA9IDcyMDAuMCwKY19zaG9ydFRpbWUgPSAwLjAwNzI0NTA2Mzc4MTczODMsCmRlcHRoVCA9IHt9LAp
> mYW1pbHkgPSB7CmNhbGN1YSA9ICJjYWxjdWEiLAp9LAptVCA9IHsKY2FsY3VhID0gewpmbiA9ICIvYXB
> wcy9hbnR3ZXJwZW4vbW9kdWxlcy9yb2NreTgvY2FsY3VhLWJyb2Fkd2VsbC9jYWxjdWEvYWxsLmx1YSI
> sCmZ1bGxOYW1lID0gImNhbGN1YS9hbGwiLApsb2FkT3JkZXIgPSAxLApwcm9wVCA9IHt9LApzdGFja0R
> lcHRoID0gMCwKc3RhdHVzID0gImFjdGl2ZSIsCnVzZXJOYW1lID0gImNhbGN1YS9hbGwiLAp3ViA9ICJ
> eYWxsLip6ZmluYWwiLAp9LAp9LAptcGF0aEEgPSB7CiIvYXBwcy9h
>     VSC_DATA=/data/antwerpen/###/########
>     LOADEDMODULES=calcua/all
>     VSC_SCRATCH_SITE=/scratch/antwerpen/###/########
>     _ModuleTable003_=d2VycGVuL21vZHVsZXMvY2VudG9zOC9zb2Z0d2FyZS1icm9hZHdlbGwvc3l
> zdGVtIgosICIvYXBwcy9hbnR3ZXJwZW4vbW9kdWxlcy9yb2NreTgvc29mdHdhcmUteDg2XzY0L2FsbCI
> KLCAiL2FwcHMvYW50d2VycGVuL21vZHVsZXMvY2VudG9zOC9zb2Z0d2FyZS14ODZfNjQiLCAiL2FwcHM
> vYW50d2VycGVuL21vZHVsZXMvcm9ja3k4L2NhbGN1YS1icm9hZHdlbGwiLAp9LApzeXN0ZW1CYXNlTVB
> BVEggPSAiL2FwcHMvYW50d2VycGVuL21vZHVsZXMvcm9ja3k4L2NhbGN1YS1icm9hZHdlbGwiLAp9Cg=
> =
>     LMOD_ROOT=/usr/share/lmod
>     CONDA_PROMPT_MODIFIER=(base)
>     VSC_ARCH_LOCAL=broadwell
>     SHELL=/bin/bash
>     _ModuleTable_Sz_=3
>     SHLVL=2
>     MANPATH=/usr/share/lmod/lmod/share/man:
[10:25:37.517] > 
>     APPTAINER_CACHEDIR=/scratch/antwerpen/###/########/apptainer/cache
>     VSC_HOME=/user/antwerpen/###/########
>     MODULEPATH=/apps/antwerpen/modules/rocky8/software-broadwell/2024a/all:/apps
> /antwerpen/modules/rocky8/software-broadwell/2023a/all:/apps/antwerpen/modules/r
> ocky8/software-broadwell/2022a/all:/apps/antwerpen/modules/rocky8/software-broad
> well/2021a/all:/apps/antwerpen/modules/centos8/software-broadwell/2020a:/apps/an
> twerpen/modules/rocky8/software-broadwell/system/all:/apps/antwerpen/modules/cen
> tos8/software-broadwell/system:/apps/antwerpen/modules/rocky8/software-x86_64/al
> l:/apps/antwerpen/modules/centos8/software-x86_64:/apps/antwerpen/modules/rocky8
> /calcua-broadwell
>     CALCUA_FAMILY_CALCUA=calcua
>     LOGNAME=vsc20380
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/2520380/bus
>     XDG_RUNTIME_DIR=/run/user/2520380
>     VSC_INSTITUTE_LOCAL=antwerpen
>     LMOD_CONFIG_DIR=/apps/antwerpen/modules/lmod
>     APPTAINER_TMPDIR=/scratch/antwerpen/###/########/apptainer/tmp
>     MODULEPATH_ROOT=/usr/share/modulefiles
>     PATH=/data/antwerpen/###/########/miniforge3/bin:/data/antwerpen/203/vsc2038
> 0/miniforge3/condabin:/user/antwerpen/###/########/.local/bin:/user/antwerpen/20
> 3/vsc20380/bin:/apps/antwerpen/scripts:/usr/local/bin:/usr/bin:/usr/local/sbin:/
> usr/sbin
>     _LMFILES_=/apps/antwerpen/modules/rocky8/calcua-broadwell/calcua/all.lua    
>     DEBUGINFOD_URLS=https://debuginfod.centos.org/
>     MODULESHOME=/usr/share/lmod/lmod
>     LMOD_SETTARG_FULL_SUPPORT=no
>     CONDA_DEFAULT_ENV=base
>     LMOD_PKG=/usr/share/lmod/lmod
>     XML_CATALOG_FILES=file:///data/antwerpen/###/########/miniforge3/etc/xml/cat
> alog file:///etc/xml/catalog
>     LMOD_CMD=/usr/share/lmod/lmod/libexec/lmod
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     LMOD_DIR=/usr/share/lmod/lmod/libexec
>     BASH_FUNC_which%%=() {  ( alias;
>      eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-fun
> ctions --show-tilde --show-dot $@
>     }
>     BASH_FUNC_module%%=() {  if [ -z "${LMOD_SH_DBG_ON+x}" ]; then
>      case "$-" in
>      *v*x*)
>      __lmod_sh_dbg='vx'
>      ;;
>      *v*)
>      __lmod_sh_dbg='v'
>      ;;
>      *x*)
>      __lmod_sh_dbg='x'
>      ;;
>      esac;
>      fi;
>      if [ -n "${__lmod_sh_dbg:-}" ]; then
>      set +$__lmod_sh_dbg;
>      echo "Shell debugging temporarily silenced: export LMOD_SH_DBG_ON=1 for Lmo
> d's output" 1>&2;
>      fi;
>      eval "$($LMOD_CMD shell "$@")" && eval "$(${LMOD_SETTARG_CMD:-:} -s sh)";  
>      __lmod_my_status=$?;
>      if [ -n "${__lmod_sh_dbg:-}" ]; then
>      echo "Shell debugging restarted" 1>&2;
>      set -$__lmod_sh_dbg;
>      fi;
>      unset __lmod_sh_dbg;
>      return $__lmod_my_status
>     }
>     BASH_FUNC_ml%%=() {  eval "$($LMOD_DIR/ml_cmd "$@")"
>     }
>     _=/usr/bin/printenv
> Removing old logfile at /data/antwerpen/###/########//.vscode-server/.cli.f1a4fb
> 101478ce6ec82fe9627c43efbf9e98c813.log
[10:25:37.528] > 
> Spawned remote CLI: 4038112
> Waiting for server log...
[10:25:37.542] > 
[10:25:37.554] > 6de0252f7c23: start
> listeningOn==127.0.0.1:45981==
> osReleaseId==rocky==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/2520380==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==46==
> execServerToken==a11a1aaa-1111-1aa1-1a1a-a1a11a1a111a==
> platformDownloadPath==cli-alpine-x64==
> 6de0252f7c23: end
[10:25:37.554] Received install output: 
listeningOn==127.0.0.1:45981==
osReleaseId==rocky==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/2520380==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==46==
execServerToken==a11a1aaa-1111-1aa1-1a1a-a1a11a1a111a==
platformDownloadPath==cli-alpine-x64==

[10:25:37.555] Remote server is listening on port 45981
[10:25:37.555] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":45981},"osReleaseId":"rocky","arch":"x86_64","tmpDir":"/run/user/2520380","platform":"linux","execServerToken":"a11a1aaa-1111-1aa1-1a1a-a1a11a1a111a"},"serverStartTime":46,"installUnpackCode":""}
[10:25:37.560] Starting forwarding server. local port 59933 -> socksPort 59929 -> remotePort 45981
[10:25:37.561] Forwarding server listening on port 59933
[10:25:37.561] Waiting for ssh tunnel to be ready
[10:25:37.563] [Forwarding server port 59933] Got connection 0
[10:25:37.564] Tunneled port 45981 to local port 59933
[10:25:37.564] Resolved "ssh-remote+calcua" to "port 59933"
[10:25:37.574] Initizing new exec server for ssh-remote+calcua
[10:25:37.574] Resolving exec server at port 59933
[10:25:37.579] [Forwarding server port 59933] Got connection 1
[10:25:37.583] > 
[10:25:37.631] Exec server for ssh-remote+calcua created and cached
[10:25:37.636] ------




[10:25:37.662] [server] Checking /data/antwerpen/###/########//.vscode-server/cli/servers/Stable-f1a4fb101478ce6ec82fe9627c43efbf9e98c813/log.txt and /data/antwerpen/###/########//.vscode-server/cli/servers/Stable-f1a4fb101478ce6ec82fe9627c43efbf9e98c813/pid.txt for a running server...
[10:25:37.704] [server] Found running server (pid=4035541)

Anything else?

Is it possible to provide a log for what happens during the shutdown process?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.