microsoft / microsoft/vscode-remote-release

[Remote-SSH Bug]: the server always reconnect and auto save action stuck always when save.

Open
#9,488 8 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
470
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
Connect Locally

It connects successfully

->

No response

Expected Behavior

I will the remote shh can keep connection always. The problem appears from 1.85.2 version.

Steps To Reproduce

No response

Remote-SSH Log
Remote-SSH Log

[10:03:14.064] Log Level: 2
[10:03:14.072] SSH Resolver called for "ssh-remote+172.18.37.77", attempt 1
[10:03:14.073] "remote.SSH.useLocalServer": false
[10:03:14.074] "remote.SSH.useExecServer": false
[10:03:14.074] "remote.SSH.showLoginTerminal": false
[10:03:14.074] "remote.SSH.remotePlatform": {"172.18.37.77":"linux"}
[10:03:14.074] "remote.SSH.path": undefined
[10:03:14.074] "remote.SSH.configFile": undefined
[10:03:14.074] "remote.SSH.useFlock": true
[10:03:14.074] "remote.SSH.lockfilesInTmp": false
[10:03:14.075] "remote.SSH.localServerDownload": auto
[10:03:14.075] "remote.SSH.remoteServerListenOnSocket": true
[10:03:14.075] "remote.SSH.showLoginTerminal": false
[10:03:14.075] "remote.SSH.defaultExtensions": []
[10:03:14.075] "remote.SSH.loglevel": 2
[10:03:14.075] "remote.SSH.enableDynamicForwarding": true
[10:03:14.075] "remote.SSH.enableRemoteCommand": false
[10:03:14.076] "remote.SSH.serverPickPortsFromRange": {}
[10:03:14.076] "remote.SSH.serverInstallPath": {}
[10:03:14.078] VS Code version: 1.86.0
[10:03:14.078] Remote-SSH version: remote-ssh@0.108.0
[10:03:14.078] win32 x64
[10:03:14.083] SSH Resolver called for host: 172.18.37.77
[10:03:14.083] Setting up SSH remote "172.18.37.77"
[10:03:14.086] Using commit id "05047486b6df5eb8d44b2ecd70ea3bdf775fd937" and quality "stable" for server
[10:03:14.088] Install and start server if needed
[10:03:14.090] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[10:03:14.091] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[10:03:14.091] Checking ssh with "C:\Windows\ssh.exe -V"
[10:03:14.092] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[10:03:14.092] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[10:03:14.093] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[10:03:14.093] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:03:14.094] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:03:14.094] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[10:03:14.120] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[10:03:14.123] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51608 "172.18.37.77" bash
[10:03:14.124] Terminal shell path: C:\Windows\System32\cmd.exe
[10:03:14.798] > 0437387e335a: running
> ]0;C:\Windows\System32\cmd.exe
[10:03:14.799] Got some output, clearing connection timeout
[10:03:14.899] > Acquiring lock on /home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/vscode-remote-lock.lzy.05047486b6df5eb8d44b2ecd70ea3bdf775fd937
[10:03:14.934] > Found existing installation at /home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937...
> Checking /home/lzy/.vscode-server/.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log and /home/lzy/.vscode-server/.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.pid for a running server
> Looking for server with pid: 217703
[10:03:15.030] > Found running server...
>  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
[10:03:15.150] > Checking server status on port 45707 with curl
[10:03:15.167] > 0437387e335a: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==45707==
> osReleaseId==debian==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==1a1aaa11-11a1-111a-aa11-111aaaa11a11==
> 0437387e335a: end
[10:03:15.169] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==45707==
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==1a1aaa11-11a1-111a-aa11-111aaaa11a11==

[10:03:15.170] Remote server is listening on port 45707
[10:03:15.170] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":45707},"osReleaseId":"debian","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1a1aaa11-11a1-111a-aa11-111aaaa11a11"},"installUnpackCode":""}
[10:03:15.173] Starting forwarding server. local port 51610 -> socksPort 51608 -> remotePort 45707
[10:03:15.174] Forwarding server listening on port 51610
[10:03:15.174] Waiting for ssh tunnel to be ready
[10:03:15.175] [Forwarding server port 51610] Got connection 0
[10:03:15.176] Tunneled port 45707 to local port 51610
[10:03:15.176] Resolved "ssh-remote+172.18.37.77" to "port 51610"
[10:03:15.181] ------




[10:03:15.196] [Forwarding server port 51610] Got connection 1
[10:03:15.197] > 
[10:03:15.216] [Forwarding server port 51610] Got connection 2
[10:03:16.151] [Forwarding server port 51610] Got connection 3
[10:03:16.175] [Forwarding server port 51610] Got connection 4
[10:03:17.769] Opening exec server for ssh-remote+172.18.37.77
[10:03:17.769] Opening exec server for ssh-remote+172.18.37.77
[10:03:17.818] Initizing new exec server for ssh-remote+172.18.37.77
[10:03:17.822] Using commit id "05047486b6df5eb8d44b2ecd70ea3bdf775fd937" and quality "stable" for server
[10:03:17.824] Install and start server if needed
[10:03:17.829] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51623 "172.18.37.77" bash
[10:03:17.908] Terminal shell path: C:\Windows\System32\cmd.exe
[10:03:18.572] > 209a6fd95465: running
> ]0;C:\Windows\System32\cmd.exe
[10:03:18.572] Got some output, clearing connection timeout
[10:03:18.643] > Found existing installation at /home/lzy/.vscode-server...
> Starting VS Code CLI... "/home/lzy/.vscode-server/code-05047486b6df5eb8d44b2ecd70ea3bdf775fd937" command-shell --cli-data-dir "/home/lzy/.vscode-server/cli" --on-port --parent-process-id 223086 &> "/home/lzy/.vscode-server/.cli.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log" < /dev/null
> printenv:
>     SHELL=/usr/bin/zsh
>     LANGUAGE=en_US:en
>     PWD=/home/lzy
>     LOGNAME=lzy
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/home/lzy
>     LANG=en_US.UTF-8
>     VSCODE_AGENT_FOLDER=/home/lzy/.vscode-server
>     SSH_CONNECTION=10.51.15.81 51624 172.18.37.77 22
>     XDG_SESSION_CLASS=user
>     USER=lzy
>     SHLVL=1
>     XDG_SESSION_ID=273
>     XDG_RUNTIME_DIR=/run/user/1000
>     SSH_CLIENT=10.51.15.81 51624 22
>     PATH=/home/lzy/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
>     OLDPWD=/home/lzy
>     _=/usr/bin/printenv
> Removing old logfile at /home/lzy/.vscode-server/.cli.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log
> Spawned remote CLI: 223105
[10:03:18.723] > Waiting for server log...
[10:03:18.758] > 
[10:03:18.780] > 209a6fd95465: start
> SSH_AUTH_SOCK====
> DISPLAY====
> listeningOn==127.0.0.1:45435==
> osReleaseId==debian==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==142==
> execServerToken==a1111aa1-a111-111a-aaa1-1a1a11a11aa1==
> 209a6fd95465: end
[10:03:18.781] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
listeningOn==127.0.0.1:45435==
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==142==
execServerToken==a1111aa1-a111-111a-aaa1-1a1a11a11aa1==

[10:03:18.781] Remote server is listening on port 45435
[10:03:18.781] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":45435},"osReleaseId":"debian","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","execServerToken":"a1111aa1-a111-111a-aaa1-1a1a11a11aa1"},"serverStartTime":142,"installUnpackCode":""}
[10:03:18.783] Starting forwarding server. local port 51626 -> socksPort 51623 -> remotePort 45435
[10:03:18.783] Forwarding server listening on port 51626
[10:03:18.783] Waiting for ssh tunnel to be ready
[10:03:18.784] [Forwarding server port 51626] Got connection 0
[10:03:18.784] Tunneled port 45435 to local port 51626
[10:03:18.784] Resolved "ssh-remote+172.18.37.77" to "port 51626"
[10:03:18.785] Resolving exec server at port 51626
[10:03:18.785] [Forwarding server port 51626] Got connection 1
[10:03:18.803] > 
[10:03:18.915] Exec server for ssh-remote+172.18.37.77 created and cached
[10:03:18.920] Verified and reusing cached exec server for ssh-remote+172.18.37.77
[10:24:58.235] [Forwarding server port 51610] Got connection 5
[10:33:45.697] [Forwarding server port 51610] Got connection 6
[10:34:50.083] [Forwarding server port 51610] Got connection 7
[10:35:35.558] [Forwarding server port 51610] Got connection 8
[10:35:55.634] [Forwarding server port 51610] Got connection 9

Anything else?

This is server log. When New EH opened, aborting shutdown log display, the reconnection action will continue at the per saving action.

2024-02-04 10:03:12.713 [info] Last EH closed, waiting before shutting down
2024-02-04 10:03:14.697 [info] Got delay-shutdown request while in shutdown timeout, delaying
2024-02-04 10:03:14.698 [info] Cancelling previous shutdown timeout
2024-02-04 10:03:14.778 [info] [127.0.0.1][57a4c169][ManagementConnection] New connection established.
2024-02-04 10:03:14.811 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] New connection established.
2024-02-04 10:03:14.848 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] <222996> Launched Extension Host Process.
2024-02-04 10:03:19.568 [error] CodeExpectedError: Could not find pty on pty host
    at A.U (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:32407)
    at A.updateIcon (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:27592)
    at U.<computed> (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:22765)
    at Object.call (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:34:5041)
    at $.s (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:5153)
    at $.q (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:4662)
    at a.value (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:4064)
    at d.y (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:27:1906)
    at d.fire (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:27:2123)
    at process.ne (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:25:10072)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
2024-02-04 10:03:19.572 [error] CodeExpectedError: Could not find pty on pty host
    at A.U (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:32407)
    at A.updateTitle (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:27539)
    at U.<computed> (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:43:22765)
    at Object.call (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:34:5041)
    at $.s (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:5153)
    at $.q (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:4662)
    at a.value (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:32:4064)
    at d.y (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:27:1906)
    at d.fire (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:27:2123)
    at process.ne (/home/lzy/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/out/vs/platform/terminal/node/ptyHostMain.js:25:10072)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
2024-02-04 10:08:14.700 [info] New EH opened, aborting shutdown
2024-02-04 10:33:45.309 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:34:49.697 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:35:35.157 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:35:55.233 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:36:15.324 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:36:35.393 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:37:07.903 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:37:27.957 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:37:48.005 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:38:08.074 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:38:28.132 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:38:48.172 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:39:08.228 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.
2024-02-04 10:39:28.276 [info] [127.0.0.1][0af465ba][ExtensionHostConnection] The client has reconnected.

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.

Research direction

Start by reviewing the Remote-SSH connection and reconnection behavior around the provided VS Code 1.86.0 logs, especially the repeated exec-server initialization and “Could not find pty on pty host” error. Reproduce the save-triggered reconnect on the reported Windows-to-Debian setup, then verify that the SSH connection remains stable and autosave no longer gets stuck.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, vscode
Domain
devtools, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.