microsoft / microsoft/vscode-remote-release

[Remote-SSH Bug]: `gnu-screen` takes forever to execute on remote server

Open
#10,079 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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
Connect Locally

It connects successfully

->

No response

Expected Behavior

I have a rather weird issue with vscode-remote and gnu-screen: when using integrated terminal on remote server, screen takes forever to run:

$ time screen -v
Screen version 4.09.00 (GNU) 30-Jan-22

________________________________________________________
Executed in   18.86 secs    fish           external
   usr time    3.06 secs  599.00 micros    3.06 secs
   sys time   15.80 secs    0.00 micros   15.80 secs

It runs perfectly well in any other connection, including ssh connection from within the integrated terminal on remote server:

$ ssh me
<...>

$ time screen -v
Screen version 4.09.00 (GNU) 30-Jan-22

________________________________________________________
Executed in   15.09 millis    fish           external
   usr time    1.33 millis    1.33 millis    0.00 millis
   sys time   13.33 millis    0.27 millis   13.07 millis

My only guess now is it is somehow related to the environment set by vscode, as it is erased when I am connecting to myself.

I tried:
— tweaking env variables to match "normal" session;
— tweaking all available remote.SSH;
— fresh installation of vscode with all extensions disabled.

None of these had any effect.

Also, it is worth mentioning, that it's a recent issue, everything worked with the same configuration until recently and I don't remember any changes on my server. Maybe something changed in a recent update of vscode or vscode-remote? I would be happy to hear any suggestions on how to debug this or what to try.

Steps To Reproduce

No response

Remote-SSH Log
Remote-SSH Log

[15:39:55.482] Log Level: 2
[15:39:55.487] VS Code version: 1.91.1
[15:39:55.487] Remote-SSH version: remote-ssh@0.112.0
[15:39:55.487] darwin arm64
[15:39:55.501] SSH Resolver called for "ssh-remote+fe", attempt 1
[15:39:55.501] "remote.SSH.useLocalServer": false
[15:39:55.501] "remote.SSH.useExecServer": false
[15:39:55.501] "remote.SSH.showLoginTerminal": true
[15:39:55.501] "remote.SSH.remotePlatform": {"fe":"linux"}
[15:39:55.501] "remote.SSH.path": undefined
[15:39:55.501] "remote.SSH.configFile": /Users/rusty/.ssh/config
[15:39:55.501] "remote.SSH.useFlock": false
[15:39:55.501] "remote.SSH.lockfilesInTmp": false
[15:39:55.501] "remote.SSH.localServerDownload": auto
[15:39:55.501] "remote.SSH.remoteServerListenOnSocket": false
[15:39:55.502] "remote.SSH.showLoginTerminal": true
[15:39:55.502] "remote.SSH.defaultExtensions": []
[15:39:55.502] "remote.SSH.loglevel": 2
[15:39:55.502] "remote.SSH.enableDynamicForwarding": false
[15:39:55.502] "remote.SSH.enableRemoteCommand": false
[15:39:55.502] "remote.SSH.serverPickPortsFromRange": {}
[15:39:55.503] "remote.SSH.serverInstallPath": {}
[15:39:55.588] SSH Resolver called for host: fe
[15:39:55.588] Setting up SSH remote "fe"
[15:39:55.588] Using commit id "f1e16e1e6214d7c44d078b1f0607b2388f29d729" and quality "stable" for server
[15:39:55.593] Install and start server if needed
[15:39:55.698] PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/openssl@3/bin:/usr/local/sbin:/usr/local/opt/mariadb@10.3/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/iTerm.app/Contents/Resources/utilities
[15:39:55.698] Checking ssh with "ssh -V"
[15:39:55.705] > OpenSSH_9.6p1, LibreSSL 3.3.6

[15:39:55.756] Using SSH config file "/Users/rusty/.ssh/config"
[15:39:55.756] Running script with connection command: ssh -T -o ClearAllForwardings=true -o ConnectTimeout=15 -F '/Users/rusty/.ssh/config' fe bash
[15:39:56.744] > 487d2db80e65: running
[15:39:56.744] Got some output, clearing connection timeout
[15:39:56.769] > Acquiring lock on /home/me/.vscode-server/bin/f1e16e1e6214d7c44d078b1f0607b2388f29d729/vscode-remote-lock.me.f1e16e1e6214d7c44d078b1f0607b2388f29d729
[15:39:56.778] > \ln "/home/me/.vscode-server/bin/f1e16e1e6214d7c44d078b1f0607b2388f29d729/vscode-remote-lock.me.f1e16e1e6214d7c44d078b1f0607b2388f29d729.target" "/home/me/.vscode-server/bin/f1e16e1e6214d7c44d078b1f0607b2388f29d729/vscode-remote-lock.me.f1e16e1e6214d7c44d078b1f0607b2388f29d729"
> Found existing installation at /home/me/.vscode-server/bin/f1e16e1e6214d7c44d078b1f0607b2388f29d729...
> Checking /home/me/.vscode-server/.f1e16e1e6214d7c44d078b1f0607b2388f29d729.log and /home/me/.vscode-server/.f1e16e1e6214d7c44d078b1f0607b2388f29d729.pid for a running server
> Looking for server with pid: 766160
[15:39:56.796] > 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).
> *
>  
[15:39:56.803] > Checking server status on port 40217 with wget
[15:39:56.815] > 487d2db80e65: start
> webUiAccessToken====
> listeningOn==40217==
> osReleaseId==debian==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/2013==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==a1111a1a-1a11-1a1a-aa11-1a11a111aa1a==
> 487d2db80e65: end
[15:39:56.815] Received install output: 
webUiAccessToken====
listeningOn==40217==
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/2013==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==a1111a1a-1a11-1a1a-aa11-1a11a111aa1a==

[15:39:56.815] Remote server is listening on port 40217
[15:39:56.816] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":40217},"osReleaseId":"debian","arch":"x86_64","webUiAccessToken":"","tmpDir":"/run/user/2013","platform":"linux","connectionToken":"a1111a1a-1a11-1a1a-aa11-1a11a111aa1a"},"installUnpackCode":""}
[15:39:56.875] Using SSH config file "/Users/rusty/.ssh/config"
[15:39:56.875] Running script with connection command: ssh -T -L 127.0.0.1:64760:127.0.0.1:40217 -o ConnectTimeout=15 -F '/Users/rusty/.ssh/config' fe bash
[15:39:56.875] Spawning tunnel with: ssh -T -L 127.0.0.1:64760:127.0.0.1:40217 -o ConnectTimeout=15 -F '/Users/rusty/.ssh/config' fe bash << 'EOSSH'
echo -e 'Connected to SSH Host - Please do not close this terminal' && while true; do sleep 180; echo -n ' '; done
EOSSH
[15:39:57.067] "install" terminal command done
[15:39:57.067] Install terminal quit with output: 
[15:39:57.729] > Connected to SSH Host - Please do not close this terminal
[15:39:57.729] Spawned SSH tunnel between local port 64760 and remote target port 40217
[15:39:57.730] Waiting for ssh tunnel to be ready
[15:39:57.732] Tunneled port 40217 to local port 64760
[15:39:57.732] Resolved "ssh-remote+fe" to "port 64760"
[15:39:57.804] ------

Anything else?

No response

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 reproducing the delay with time screen -v in the VS Code Remote-SSH integrated terminal and compare it with the nested SSH session described in the issue. Review the Remote-SSH settings and log, especially the remote server environment and terminal startup path; done means identifying a reproducible cause and confirming that screen executes normally through Remote-SSH.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
devtools, infrastructure
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.