Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Remote-SSH Bug]: Could not establish connection with remoteServerListenOnSocket #8948

Closed
3 tasks done
ziposcar opened this issue Sep 11, 2023 · 26 comments
Closed
3 tasks done
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded

Comments

@ziposcar
Copy link

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

Successfully connected.

Steps To Reproduce

I have always turned on option remote.SSH.remoteServerListenOnSocket before. But today I got the error below. So I tried turning off the remote.SSH.remoteServerListenOnSocket and got the same error as 8943.

So I tried setting the remote.SSH.useExecServer to false, which works for me. But when I set the remote.SSH.remoteServerListenOnSocket to true, it still doesn't work.

So now my settings are:

{
    "remote.SSH.remoteServerListenOnSocket": true,
    "remote.SSH.useExecServer": false
}

My environments are

client: MacOS 13.5.2
VScode: 1.82.0
remote: debian 9

Remote-SSH Log

[12:58:41.593] Log Level: 2
[12:58:41.599] VS Code version: 1.82.0
[12:58:41.599] Remote-SSH version: remote-ssh@0.106.2
[12:58:41.599] darwin arm64
[12:58:41.663] SSH Resolver called for "ssh-remote+10.37.5.237", attempt 1
[12:58:41.663] "remote.SSH.useLocalServer": false
[12:58:41.664] "remote.SSH.showLoginTerminal": false
[12:58:41.664] "remote.SSH.remotePlatform": {"10.227.7.212":"linux","10.231.248.244":"linux","10.37.5.237":"linux"}
[12:58:41.664] "remote.SSH.path": undefined
[12:58:41.664] "remote.SSH.configFile": undefined
[12:58:41.664] "remote.SSH.useFlock": true
[12:58:41.664] "remote.SSH.lockfilesInTmp": false
[12:58:41.664] "remote.SSH.localServerDownload": auto
[12:58:41.664] "remote.SSH.remoteServerListenOnSocket": true
[12:58:41.664] "remote.SSH.showLoginTerminal": false
[12:58:41.664] "remote.SSH.defaultExtensions": []
[12:58:41.667] "remote.SSH.loglevel": 2
[12:58:41.667] "remote.SSH.enableDynamicForwarding": true
[12:58:41.667] "remote.SSH.enableRemoteCommand": false
[12:58:41.667] "remote.SSH.serverPickPortsFromRange": {}
[12:58:41.667] "remote.SSH.serverInstallPath": {}
[12:58:41.670] SSH Resolver called for host: 10.37.5.237
[12:58:41.670] Setting up SSH remote "10.37.5.237"
[12:58:41.672] Using commit id "8b617bd08fd9e3fc94d14adb8d358b56e3f72314" and quality "stable" for server
[12:58:41.674] Install and start server if needed
[12:58:41.675] PATH: /Users/liyichao/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/puppetlabs/bin:/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:/Users/liyichao/Library/Application Support/JetBrains/Toolbox/scripts:/Users/liyichao/goworkspace/bin:/bin:/Users/liyichao/Library/Android/sdk/emulator:/Users/liyichao/Library/Android/sdk/platform-tools
[12:58:41.675] Checking ssh with "ssh -V"
[12:58:41.745] > OpenSSH_9.0p1, LibreSSL 3.3.6

[12:58:41.747] Running script with connection command: ssh -T -D 51520 -o ConnectTimeout=15 '10.37.5.237' bash
[12:58:42.860] > aa24dd4f3917: running
[12:58:42.861] Got some output, clearing connection timeout
[12:58:42.889] > Acquiring lock on /data00/home/liyichao/.vscode-server/bin/8b617bd08fd9e3fc94d14adb8d358b56e3f72314/vscode-remote-lock.liyichao.8b617bd08fd9e3fc94d14adb8d358b56e3f72314
> Found existing installation at /data00/home/liyichao/.vscode-server/bin/8b617bd08fd9e3fc94d14adb8d358b56e3f72314...
> Checking /data00/home/liyichao/.vscode-server/.8b617bd08fd9e3fc94d14adb8d358b56e3f72314.log and /data00/home/liyichao/.vscode-server/.8b617bd08fd9e3fc94d14adb8d358b56e3f72314.pid for a running server
> Looking for server with pid: 214633
[12:58:42.940] > Running ssh connection command... /data00/home/liyichao/.vscode-server/bin/8b617bd08fd9e3fc94d14adb8d358b56e3f72314/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown  --telemetry-level all --socket-path=/run/user/1001/vscode-ssh-remote-server-sock-1694408322  &> "/data00/home/liyichao/.vscode-server/.8b617bd08fd9e3fc94d14adb8d358b56e3f72314.log" < /dev/null
> printenv:
>     SHELL=/bin/zsh
>     PWD=/data00/home/liyichao
>     LOGNAME=liyichao
>     HOME=/data00/home/liyichao
>     LANG=en_US.UTF-8
>     VSCODE_AGENT_FOLDER=/data00/home/liyichao/.vscode-server
>     SSH_CONNECTION=10.91.93.148 51521 10.37.5.237 22
>     USER=liyichao
>     SHLVL=1
>     XDG_SESSION_ID=32
>     XDG_RUNTIME_DIR=/run/user/1001
>     SSH_CLIENT=10.91.93.148 51521 22
>     PATH=/data00/home/liyichao/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
>     OLDPWD=/data00/home/liyichao
>     _=/usr/bin/printenv
> Removing old logfile at /data00/home/liyichao/.vscode-server/.8b617bd08fd9e3fc94d14adb8d358b56e3f72314.log
> Spawned remote server: 259837
> Waiting for server log...
[12:58:42.971] > Waiting for server log...
[12:58:43.166] > Waiting for server log...
>  
> *
> * 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).
> *
>  
> aa24dd4f3917: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==/run/user/1001/vscode-ssh-remote-server-sock-1694408322==
> osReleaseId==debian==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1001==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime==123==
> connectionToken==1a11aa1a-111a-1aaa-a1a1-1111a1aaa111==
> aa24dd4f3917: end
[12:58:43.167] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==/run/user/1001/vscode-ssh-remote-server-sock-1694408322==
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1001==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==123==
connectionToken==1a11aa1a-111a-1aaa-a1a1-1111a1aaa111==

[12:58:43.167] Failed to parse remote port from server output
[12:58:43.170] Resolver error: Error: 
	at g.Create (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:637875)
	at t.handleInstallOutput (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:635278)
	at t.tryInstall (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:756874)
	at async /Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:717466
	at async t.withShowDetailsEvent (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:720719)
	at async C (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:714380)
	at async t.resolve (/Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:718115)
	at async /Users/liyichao/.vscode/extensions/ms-vscode-remote.remote-ssh-0.106.2/out/extension.js:2:901741
[12:58:43.172] ------

Anything else?

No response

@ziposcar ziposcar added the ssh Issue in vscode-remote SSH label Sep 11, 2023
@ziposcar
Copy link
Author

I've tried reinstalling and restarting, but nothing works.

@hxzhao527
Copy link

hxzhao527 commented Sep 11, 2023

I rollback Remote - SSH to v0.105.1, work fine.
image

@kevin-valerio
Copy link

kevin-valerio commented Sep 11, 2023

I rollback Remote - SSH to v0.105.1, work fine.

Thanks. Version 0.106.1 seems also stable for me.

@ziposcar
Copy link
Author

I rollback Remote - SSH to v0.105.1, work fine.

Thanks. Version 0.106.1 seems also stable for me.

I got same error at version 0.106.1. Do you set remote.SSH.remoteServerListenOnSocket to true?

I found that the latest version that is stable for me is 0.106.0.

@kevin-valerio
Copy link

I rollback Remote - SSH to v0.105.1, work fine.

Thanks. Version 0.106.1 seems also stable for me.

I got same error at version 0.106.1. Do you set remote.SSH.remoteServerListenOnSocket to true?

I found that the latest version that is stable for me is 0.106.0.

Weird. remoteServerListenOnSocket is also enabled for me, yes.

@chrisber
Copy link

Same problem here. Installing Version 0.106.1 on Remote worked. Thx!

@filipenos
Copy link

same problem here. Installing Version 0.106.1 fix

@ziposcar
Copy link
Author

I think I got the rule. During "remote.SSH.remoteServerListenOnSocket": true:
"remote.SSH.useExecServer": true is work for me with version 0.106.1, and "remote.SSH.useExecServer": false will throw errors.
But
"remote.SSH.useExecServer": false is work for me with version 0.106.2, and "remote.SSH.useExecServer": true will throw errors.
lol. Hope this information helps.

@tiagovrtr
Copy link

I'm experiencing the same issue with 0.106.2 with remote.SSH.remoteServerListenOnSocket" set to either true or false, rolling back to 0.105.1 seems to solve the issue

@raspersi
Copy link

Same here, switched to 0.105.1 and it works fine. Btw It took me several hours to realize what the problem is.

@HarryHung
Copy link

Similar issue, was able to establish initial connection, but then got disconnected shortly, VS Code automatically attempt to reconnect a few times, and then stopped by an error message.

Rolled back to 0.106.1 seems to fix the issue for me as well.

@zjysteven
Copy link

Similar here. I was getting "Cannot reconnect. Please reload the window." error, and switching back to 0.105.1 fixed it.

@frank-hopkin-accrisoft
Copy link

Similar here. I was also getting "Cannot reconnect. Please reload the window." error, and switching back to 0.105.1 fixed it for me as well.

@doctornkz-intelas
Copy link

doctornkz-intelas commented Sep 11, 2023

The same issue, reverted to 105,
ps. once the client hunged up my sft-okta agent and I restarted the bastion forcefully.

@blakeduffey
Copy link

Reporting same - vscode connecting to remote system hangs. Roll back extension - works again.

@SomervilleTom
Copy link

Same bug here. Remote machine is AWS EC2 instance running Rocky Linux. Local machine is Windows 10 Pro.

Unable to establish any remote connection.

I will GREATLY appreciate a pointer to how I can revert my "Remote SSH" extension, since that seems to be the issue. I don't see anything in the VSCode UI that allows me to revert to an earlier version of "Remote SSH".

@zjysteven
Copy link

I rollback Remote - SSH to v0.105.1, work fine. image

@SomervilleTom see this comment

@SomervilleTom
Copy link

I rollback Remote - SSH to v0.105.1, work fine. image

@SomervilleTom see this comment

AWESOME! This is exactly what I needed, thank you!

@SomervilleTom
Copy link

Reverting "Remote SSH" to v105.1 solved it for me (props to @zjysteven for the quick tip).

Sounds like a bug in "Remote SSH"? Might also be worth exploring why this bug wasn't picked up in release testing for the combination of vscode 1.82 and "Remote SSH" versions after 105.1.

@stephenfrost
Copy link

stephenfrost commented Sep 11, 2023

In local settings (i.e., under "user" in settings, remote SSH) I have this:
"remote.SSH.useExecServer": false
And on remote server settings (i.e., under "remote <server_name>" in settings, remote SSH) I have this (within <home dir>/.vscode-server/data/Machine/settings.json):
"remote.SSH.remoteServerListenOnSocket": true

The above settings work for me up to remote SSH extension version "v0.106.0" but not any of the following more recent versions:

  • v0.106.1 (release)
  • v0.106.2 (release)
  • v0.106.3 (release)
  • v0.107.2023091115 (pre-release)

Something changed between 0.106.0 and 0.106.1 to make the above settings not work. Or else it's a difference in interaction between these versions and VS Code release version 1.82.0.

Other info:
All the above are with AllowStreamLocalForwarding turned on in remote server's sshd_config file.
Setting "remote.SSH.useExecServer" to true would not work for me in any version, because my remotes don't have Internet access. This issue sheds some light on problem with this setting: #8926. A fix from MS is expected.

@diego-santacruz
Copy link

I also experience the same problem when I set remoteServerListenOnSocket = true.
Note that I have useExecServer = true.
The problem is present in 0.106.2 and 0.106.3. Installing version 0.106.1 fixes the issue for me.

@Nuthouse01
Copy link

I have been suffering from the same problem all morning! Thank you very much for the fix, downgrading from v0.106.3 to v0.105.0 has fixed it for me!! One of my failed connection logs is attached, just in case.
vscode-cant-connect.txt

@atsuyaourt
Copy link

I also experience the same problem when I set remoteServerListenOnSocket = true. Note that I have useExecServer = true. The problem is present in 0.106.2 and 0.106.3. Installing version 0.106.1 fixes the issue for me.

I can confirm that 0.106.1 is working

@ziposcar
Copy link
Author

FYI. The latest v0.107.2023091115 is not worked, but v0.107.2023090815 is fine.

@roblourens roblourens changed the title [Remote-SSH Bug]: Could not establish connection [Remote-SSH Bug]: Could not establish connection with remoteServerListenOnSocket Sep 12, 2023
@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Sep 12, 2023
@roblourens roblourens added this to the September 2023 milestone Sep 12, 2023
@roblourens
Copy link
Member

This will be released in 0.106.4 shortly

@Nuthouse01
Copy link

I confirm that my problem is solved with 0.106.4. I never changed any of my settings. Thanks for the quick response!

@amunger amunger added the verified Verification succeeded label Sep 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests