Remote ssh hangs indefinitely when trying to open a folder if the terminal is not wide enough
- VSCode Version: 1.61.2
- Local OS Version: Windows 10
- Remote OS Version: Ubuntu 20.04
- Remote Extension/Connection Type: SSH
- Logs:
Steps to Reproduce:
- Move the terminal pane to the left and narrow it so it's only about 40 chars wide
- Open remote folder with ssh
- Wait indefinitely at "setting up ssh tunnel"
- Widen the terminal pane
- Success
OR
- Move the terminal pane to the left and narrow it so it's only about 40 chars wide
- Open remote ssh
- Success
- Open folder on the remote
- Wait indefinitely at "setting up ssh tunnel"
- Widen the terminal pane
- Success
Problem Description
- Most times opening a remote folder via ssh-remote hangs indefinitely while the notification dialog says "setting up ssh tunnel".
- This is not a deterministic problem but I can reproduce it about 90% of the time
- It is related to the width of the terminal(!). If I resize the terminal or move it to the bottom it works
- Opening the remote machine (i.e. not a folder on the machine but the machine directly) works fine, it's only when I try to open a folder on the remote it fails again
Best regards, Stefan
Huh this is strange. Thanks for submitting!
Would you be also able to grab the Remote-SSH logs on the output tab and post them here?
@Tyriar or @sbatten do either you have any idea why the size and position of the terminal window would effect the connection?
The log is below. At that point it just hangs indefinitely.
Another tidbit: Resizing the output tab doesn't work, you have to have the terminal selected.
I.e. I just switched to the output tab to copy the log below and then resized to get the connection going. That didn't work and I was confused until I remembered to switch back to the terminal. As soon as I'd opened the terminal tab, it resized its content and the connection was established. Apparently the terminal doesn't get actually resized unless it's visible.
[22:39:15.017] Log Level: 2
[22:39:15.020] [email protected]
[22:39:15.021] win32 x64
[22:39:15.051] SSH Resolver called for "ssh-remote+control-0", attempt 1
[22:39:15.052] "remote.SSH.useLocalServer": false
[22:39:15.052] "remote.SSH.showLoginTerminal": true
[22:39:15.052] "remote.SSH.remotePlatform": {"control-0":"linux",...}
[22:39:15.052] "remote.SSH.path": undefined
[22:39:15.052] "remote.SSH.configFile": undefined
[22:39:15.053] "remote.SSH.useFlock": true
[22:39:15.053] "remote.SSH.lockfilesInTmp": false
[22:39:15.053] "remote.SSH.localServerDownload": auto
[22:39:15.053] "remote.SSH.remoteServerListenOnSocket": true
[22:39:15.053] "remote.SSH.showLoginTerminal": true
[22:39:15.054] "remote.SSH.defaultExtensions": []
[22:39:15.054] "remote.SSH.loglevel": 2
[22:39:15.054] SSH Resolver called for host: control-0
[22:39:15.054] Setting up SSH remote "control-0"
[22:39:15.060] Using commit id "..." and quality "stable" for server
[22:39:15.066] Install and start server if needed
[22:39:15.071] Checking ssh with "ssh -V"
[22:39:15.124] > OpenSSH_for_Windows_8.1p1
[22:39:15.124] > , LibreSSL 3.0.2
[22:39:15.132] Running script with connection command: ssh -T -D 64067 "control-0" bash
[22:39:15.134] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[22:39:15.711] > ]0;C:\WINDOWS\System32\cmd.exe
[22:39:15.711] Got some output, clearing connection timeout
[22:39:15.723] >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
[22:39:16.272] > a53cf04af24f: running
[22:39:16.320] > Acquiring lock on /home/stefan.frit
> sch/.vscode-server/bin/6cba118ac49a
> 1b88332f312a8f67186f7f3c1643/vscode
> -remote-lock.stefan.fritsch.6cba118
> ac49a1b88332f312a8f67186f7f3c1643
[22:39:16.348] > Found existing installation at /hom
> e/stefan.fritsch/.vscode-server/bin
> /6cba118ac49a1b88332f312a8f67186f7f
> 3c1643...
> Checking /home/stefan.fritsch/.vsco
> de-server/.6cba118ac49a1b88332f312a
> 8f67186f7f3c1643.log and /home/stef
> an.fritsch/.vscode-server/.6cba118a
> c49a1b88332f312a8f67186f7f3c1643.pi
> d for a running server
[22:39:16.357] > Looking for server with pid: 30919
> Found running server...
[22:39:16.376] >
> *
> * Reminder: You may only use this s
> oftware with Visual Studio family p
> roducts,
> * as described in the license (http
> s://go.microsoft.com/fwlink/?linkid
> =2077057)
> *
>
[22:39:16.393] > Checking server status on socket /t
> mp/vscode-ssh-remote-server-sock-16
> 35955875 with curl
[22:39:16.421] > a53cf04af24f: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==/tmp/vscode-ssh-remote
> -server-sock-1635955875==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==08caf567-5bf0-4119
> -9beb-c4d3cad47928==
> a53cf04af24f: end
[22:39:16.421] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==/tmp/vscode-ssh-remote
-server-sock-1635955875==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==08caf567-5bf0-4119
-9beb-c4d3cad47928==
[22:39:16.422] Remote server is listening on /tmp/vscode-ssh-remote-server-sock-1635955875
[22:39:16.422] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"socketPath":"/tmp/vscode-ssh-remote-server-sock-1635955875"},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/tmp","platform":"linux","connectionToken":"11aaa111-1aa1-1111-1aaa-a1a1aaa11111"},"installUnpackCode":""}
[22:39:16.426] Running script with connection command: ssh -T -L 127.0.0.1:64069:/tmp/vscode-ssh-remote-server-sock-1635955875 control-0 bash
[22:39:16.429] Spawning tunnel with: type "C:\Users\STEFAN~1\AppData\Local\Temp\vscode-linux-multi-line-command-control-0-661451325.sh" | ssh -T -L 127.0.0.1:64069:/tmp/vscode-ssh-remote-server-sock-1635955875 control-0 bash
[22:39:16.429] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[22:39:16.748] > fritsch/.vscode-server
> /.6cba118ac49a1b88332f
> 312a8f67186f7f3c1643.l
> og and /home/stefan.fr
> itsch/.vscode-server/.
> 6cba118ac49a1b88332f31
> 2a8f67186f7f3c1643.pid
> for a running server
> Looking for server wit
> h pid: 30919
> Found running server..
> .
>
> *
> * Reminder: You may on
> ly use this software w
> ith Visual Studio fami
> ly products,
> * as described in the
> license (https://go.mi
> crosoft.com/fwlink/?li
> nkid=2077057)
> *
>
> Checking server status
> on socket /tmp/vscode
> -ssh-remote-server-soc
> k-1635955875 with curl
>
> a53cf04af24f: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==/tmp/vsco
> de-ssh-remote-server-s
> ock-1635955875==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==08caf
> 567-5bf0-4119-9beb-c4d
> 3cad47928==
> a53cf04af24f: end
>
[22:39:16.938] > ]0;C:\WINDOWS\System32\cmd.exe
[22:39:16.956] >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
[22:39:17.476] > SSH_AUTH_SOCK=
> Connected to SSH Hos
> t - Please do not cl
> ose this terminal
@roblourens any idea what would fail here? Looks like it was successful based on the log:
[22:39:17.476] > SSH_AUTH_SOCK=
> Connected to SSH Hos
> t - Please do not cl
> ose this terminal
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
@tanhakabir Is there a reason this was closed? I thought I'd provided the info you requested.
Oh sorry the bot closed
Have you disabled remote.SSH.enableDynamicForwarding? Does it work if you enable it?
The bug would be because the interactors don't ignore newlines, only the one that gets the install result does. So the one looking for that success message doesn't activate. https://github.com/Microsoft/vscode-remote-ssh/blob/eaca015f4e56e4e735fad32c3cd278828c56fd1b/open-ssh-remote/src/ssh-tunnels.ts#L165
Have you disabled
remote.SSH.enableDynamicForwarding? Does it work if you enable it?
I tried this, and it still does not work. It shows that it is connected, but it cannot open the terminal and keeps trying to reconnect over and over again. Here are my logs:
[12:22:31.716] Log Level: 2
[12:22:31.723] VS Code version: 1.82.2
[12:22:31.723] Remote-SSH version: [email protected]
[12:22:31.724] win32 x64
[12:22:31.727] SSH Resolver called for "ssh-remote+home-research", attempt 1
[12:22:31.727] "remote.SSH.useLocalServer": false
[12:22:31.727] "remote.SSH.useExecServer": false
[12:22:31.727] "remote.SSH.showLoginTerminal": false
[12:22:31.727] "remote.SSH.remotePlatform": {"192.168.196.73":"linux","home-research":"linux","hypergator":"linux","hipergator":"linux","hpg2.rc.ufl.edu":"linux","school-research":"linux"}
[12:22:31.727] "remote.SSH.path": undefined
[12:22:31.727] "remote.SSH.configFile": undefined
[12:22:31.727] "remote.SSH.useFlock": true
[12:22:31.728] "remote.SSH.lockfilesInTmp": false
[12:22:31.728] "remote.SSH.localServerDownload": auto
[12:22:31.728] "remote.SSH.remoteServerListenOnSocket": false
[12:22:31.728] "remote.SSH.showLoginTerminal": false
[12:22:31.728] "remote.SSH.defaultExtensions": []
[12:22:31.728] "remote.SSH.loglevel": 2
[12:22:31.728] "remote.SSH.enableDynamicForwarding": false
[12:22:31.728] "remote.SSH.enableRemoteCommand": false
[12:22:31.729] "remote.SSH.serverPickPortsFromRange": {}
[12:22:31.729] "remote.SSH.serverInstallPath": {}
[12:22:31.735] SSH Resolver called for host: home-research
[12:22:31.735] Setting up SSH remote "home-research"
[12:22:31.736] Using commit id "abd2f3db4bdb28f9e95536dfa84d8479f1eb312d" and quality "stable" for server
[12:22:31.737] Install and start server if needed
[12:22:31.738] Checking ssh with "D:\Software\VulkanSDK\1.3.250.1\Bin\ssh.exe -V"
[12:22:31.740] Got error from ssh: spawn D:\Software\VulkanSDK\1.3.250.1\Bin\ssh.exe ENOENT
[12:22:31.740] Checking ssh with "C:\Windows\System32\HWAudioDriver\ssh.exe -V"
[12:22:31.741] Got error from ssh: spawn C:\Windows\System32\HWAudioDriver\ssh.exe ENOENT
[12:22:31.741] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[12:22:31.742] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[12:22:31.742] Checking ssh with "C:\Windows\ssh.exe -V"
[12:22:31.743] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[12:22:31.743] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[12:22:31.743] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[12:22:31.743] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[12:22:31.744] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[12:22:31.744] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[12:22:31.784] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
[12:22:31.788] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -o ClearAllForwardings=true "home-research" bash
[12:22:31.790] Terminal shell path: C:\Windows\System32\cmd.exe
[12:22:33.800] > Warning: No xauth data; using fake authentication data for X11 forwarding.
> ]0;C:\Windows\System32\cmd.exe
[12:22:33.800] Got some output, clearing connection timeout
[12:22:33.949] > 7da4cd814698: running
[12:22:33.999] > Acquiring lock on /home/user/.vscode-server/bin/abd2f3db4bdb28f9e95536dfa84d8479f1eb312d/vscode-remote-lock.user.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
[12:22:34.018] > Found existing installation at /home/user/.vscode-server/bin/abd2f3db4bdb28f9e95536dfa84d8479f1eb312d...
> Checking /home/user/.vscode-server/.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d.log and /home/user/.vscode-server/.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d.pid for a running server
> Looking for server with pid: 2796823
[12:22:34.035] > 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
[12:22:34.098] > * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>
> Checking server status on port 46637 with wget
> 7da4cd814698: start
> DISPLAY==localhost:10.0==
> webUiAccessToken====
> listeningOn==46637==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==111a1111-111a-1a11-a11a-aa11aa11a1aa==
> 7da4cd814698: end
[12:22:34.098] Received install output:
DISPLAY==localhost:10.0==
webUiAccessToken====
listeningOn==46637==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==111a1111-111a-1a11-a11a-aa11aa11a1aa==
[12:22:34.099] Remote server is listening on port 46637
[12:22:34.099] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46637},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","display":"localhost:10.0","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"111a1111-111a-1a11-a11a-aa11aa11a1aa"},"installUnpackCode":""}
[12:22:34.102] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:2683:127.0.0.1:46637 "home-research" bash
[12:22:34.103] Spawning tunnel with: type "C:\Users\user\AppData\Local\Temp\vscode-linux-multi-line-command-home-research-807802196.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:2683:127.0.0.1:46637 "home-research" bash
[12:22:34.103] Terminal shell path: C:\Windows\System32\cmd.exe
[12:22:34.118] >
[12:22:35.378] "install" terminal command done
[12:22:35.378] Install terminal quit with output:
[12:22:36.199] > Warning: No xauth data; using fake authentication data for X11 forwarding.
> ]0;C:\Windows\System32\cmd.exe
[12:22:36.383] >
> Connected to SSH Host - Please do not close this terminal
[12:22:36.383] Spawned SSH tunnel between local port 2683 and remote target port 46637
[12:22:36.384] Waiting for ssh tunnel to be ready
[12:22:36.385] Tunneled port 46637 to local port 2683
[12:22:36.386] Resolved "ssh-remote+home-research" to "port 2683"
[12:22:36.386] Remote extension host environment: {"DISPLAY":"localhost:10.0"}
[12:22:36.390] ------
[12:22:57.268] ------
[12:22:57.268] SSH Resolver called for "ssh-remote+home-research", attempt 2, (Reconnection)
[12:22:57.269] SSH Resolver called for host: home-research
[12:22:57.269] Setting up SSH remote "home-research"
[12:22:57.269] Using commit id "abd2f3db4bdb28f9e95536dfa84d8479f1eb312d" and quality "stable" for server
[12:22:57.271] Install and start server if needed
[12:22:57.275] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -o ClearAllForwardings=true "home-research" bash
[12:22:57.276] Terminal shell path: C:\Windows\System32\cmd.exe
[12:22:59.387] > Warning: No xauth data; using fake authentication data for X11 forwarding.
> ]0;C:\Windows\System32\cmd.exe
[12:22:59.388] Got some output, clearing connection timeout
[12:22:59.539] > de82fcf81abc: running
[12:22:59.572] > Acquiring lock on /home/user/.vscode-server/bin/abd2f3db4bdb28f9e95536dfa84d8479f1eb312d/vscode-remote-lock.user.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
> Found existing installation at /home/user/.vscode-server/bin/abd2f3db4bdb28f9e95536dfa84d8479f1eb312d...
> Checking /home/user/.vscode-server/.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d.log and /home/user/.vscode-server/.abd2f3db4bdb28f9e95536dfa84d8479f1eb312d.pid for a running server
[12:22:59.590] > Looking for server with pid: 2796823
[12:22:59.607] > Found running server...
>
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
[12:22:59.637] > * 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).
> *
>
> Checking server status on port 46637 with wget
> de82fcf81abc: start
> DISPLAY==localhost:11.0==
> webUiAccessToken====
> listeningOn==46637==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==111a1111-111a-1a11-a11a-aa11aa11a1aa==
> de82fcf81abc: end
[12:22:59.637] Received install output:
DISPLAY==localhost:11.0==
webUiAccessToken====
listeningOn==46637==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==111a1111-111a-1a11-a11a-aa11aa11a1aa==
[12:22:59.638] Remote server is listening on port 46637
[12:22:59.638] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46637},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","display":"localhost:11.0","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"111a1111-111a-1a11-a11a-aa11aa11a1aa"},"installUnpackCode":""}
[12:22:59.639] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:2718:127.0.0.1:46637 "home-research" bash
[12:22:59.640] Spawning tunnel with: type "C:\Users\user\AppData\Local\Temp\vscode-linux-multi-line-command-home-research-798386545.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:2718:127.0.0.1:46637 "home-research" bash
[12:22:59.640] Terminal shell path: C:\Windows\System32\cmd.exe
[12:22:59.657] >
[12:23:00.910] "install" terminal command done
[12:23:00.910] Install terminal quit with output:
[12:23:01.473] > Warning: No xauth data; using fake authentication data for X11 forwarding.
> ]0;C:\Windows\System32\cmd.exe
[12:23:01.670] >
> Connected to SSH Host - Please do not close this terminal
[12:23:01.670] Spawned SSH tunnel between local port 2718 and remote target port 46637
[12:23:01.671] Waiting for ssh tunnel to be ready
[12:23:01.672] Tunneled port 46637 to local port 2718
[12:23:01.672] Resolved "ssh-remote+home-research" to "port 2718"
[12:23:01.672] Remote extension host environment: {"DISPLAY":"localhost:11.0"}
bump
steps i did that resolved this:
1: choose "Local Server Download" : off 2: toggle "Show Login Terminal" to on
Not sure the second one has to do with it tho, I just did this in Settings and it worked, finally. Before the process seemed to hang while downloading some stuff - VScode could not open a file view and show me my remote folders. i configured it to open a specific folder in my home directory as root directory in vscode, if that helps.
anyone figured this out I am stuck here from past 2 days and does not seem to ssh?
If this is the original bug, it will start working once your terminal is at least 60-70 characters wide. So, zoom out of VSCode (ctrl+-), reduce the font size and/or make sure the terminal is the full width.
If your terminal is at least 80 characters wide and your ssh doesn't connect, then it's not this bug.