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

vscode remote ssh hangs #6399

Closed
shardulkumar79 opened this issue Feb 28, 2022 · 14 comments
Closed

vscode remote ssh hangs #6399

shardulkumar79 opened this issue Feb 28, 2022 · 14 comments
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@shardulkumar79
Copy link

shardulkumar79 commented Feb 28, 2022

vscode remote ssh hangs while establishing ssh connection from VS Code on Windows to Linux server.

  • VSCode Version: 1.63.2
  • Local OS Version: win 10
  • Remote OS Version: ubuntu 20
  • Remote Extension/Connection Type: SSH
  • Logs:

Steps to Reproduce:

  1. install remote ssh connection extension in VS Code
  2. connect using ssh credential to Ubuntu server

logs:

ravi@172.30.156.59's password:
a1c875fc3826: running
Acquiring lock on /home/ravi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/vscode-remote-lock.ravi.899d46d82c4c95423fb7e10e68eba52050e30ba3
Found existing installation at /home/ravi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3...
Checking /home/ravi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.log and /home/ravi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.pid for a running server
Looking for server with pid: 3056281
Starting server with command... /home/ravi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --port=0    &> "/home/ravi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.log" < /dev/null
printenv:
    SHELL=/bin/bash
    LANGUAGE=en_IN:en
    PWD=/home/ravi
    LOGNAME=ravi
    XDG_SESSION_TYPE=tty
    MOTD_SHOWN=pam
    HOME=/home/ravi
    LANG=en_IN
    VSCODE_AGENT_FOLDER=/home/ravi/.vscode-server
    SSH_CONNECTION=192.168.151.25 61338 10.61.62.152 22
    XDG_SESSION_CLASS=user
    USER=ravi
    SHLVL=0
    XDG_SESSION_ID=2436
    XDG_RUNTIME_DIR=/run/user/1000
    SSH_CLIENT=192.168.151.25 61338 22
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
    _=/usr/bin/printenv
Spawned remote server: 725142
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
 
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*

a1c875fc3826: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==42211==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==408==
connectionToken==642b7886-822d-4cef-8f81-32916f291880==
a1c875fc3826: end
@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Feb 28, 2022
@tanhakabir
Copy link

Is this your full set of logs? I think there may be some things missing at the beginning and end

@tanhakabir tanhakabir added the info-needed Issue requires more information from poster label Mar 1, 2022
@codedawi
Copy link

codedawi commented Mar 2, 2022

Experiencing same issue

@nntantidakis
Copy link

Also i have the same problem. What happens is the vscode process on VM hangs up while trying to load git, eating all the ram and eventually force closes. I tried to raise the ram up to 16gb, reaches 8gb and then again force closes.
image
image

The problem is located to a plugin used by GitLens, GitKraken Auhtentication(Found it with extention bisect). Its not vscode issue, if we face the same problem. Disabling this plugin, however disables also gitlens.

@tanhakabir
Copy link

@shardulkumar79 and @codedawi are you both using GitLens as well? Could you run Extension Bisect to see if it's the same issue. For now I'll create a link to this issue in a new issue on the GitLens extension

@tanhakabir
Copy link

@nntantidakis I believe the Gitlens extension was updated with a fix that removed the problematic dependency. Could you verify this fixed it for you?

@nntantidakis
Copy link

@nntantidakis I believe the Gitlens extension was updated with a fix that removed the problematic dependency. Could you verify this fixed it for you?

Actually no. Latest version of gitlens reproduces the same bug, and had to revert to previous version of Gitlens without this extra plugin, and this gitlens+ subscription. This fixed my problem. But for me its not vscode issue for sure.

@shardulkumar79
Copy link
Author

Is this your full set of logs? I think there may be some things missing at the beginning and end

yes this is the full log.

@shardulkumar79
Copy link
Author

@shardulkumar79
Copy link
Author

shardulkumar79 commented Mar 4, 2022

@shardulkumar79 and @codedawi are you both using GitLens as well? Could you run Extension Bisect to see if it's the same issue. For now I'll create a link to this issue in a new issue on the GitLens extension

@tanhakabir no i do not use gitlens.

@tanhakabir
Copy link

@shardulkumar79 did you mean to close this issue?

@shardulkumar79
Copy link
Author

@shardulkumar79 did you mean to close this issue?

@tanhakabir i do not use gitlense. plz let me know how to ix this issue? plz do not close this bug, my issue is not resolved

@tanhakabir tanhakabir reopened this Mar 7, 2022
@tanhakabir
Copy link

@shardulkumar79 I still need your full logs to debug since in your original post doesn't seem to show any error. Do you have a screen recording of what happens or more information after a1c875fc3826: end

I'm expecting logs that look like:

[11:24:06.311] Log Level: 2
[11:24:06.313] remote-ssh@0.77.2022030315
[11:24:06.313] darwin x64
[11:24:06.321] SSH Resolver called for "ssh-remote+second", attempt 1
[11:24:06.323] "remote.SSH.useLocalServer": true
[11:24:06.323] "remote.SSH.path": undefined
[11:24:06.323] "remote.SSH.configFile": 
[11:24:06.324] "remote.SSH.useFlock": true
[11:24:06.324] "remote.SSH.lockfilesInTmp": false
[11:24:06.324] "remote.SSH.localServerDownload": auto
[11:24:06.324] "remote.SSH.remoteServerListenOnSocket": false
[11:24:06.324] "remote.SSH.showLoginTerminal": false
[11:24:06.324] "remote.SSH.defaultExtensions": []
[11:24:06.325] "remote.SSH.loglevel": 2
[11:24:06.325] "remote.SSH.enableDynamicForwarding": true
[11:24:06.325] "remote.SSH.enableRemoteCommand": true
[11:24:06.325] "remote.SSH.serverPickPortsFromRange": {"work-main":{"start":60000,"end":61000},"work-test":{"start":60000,"end":61000},"localhost":{"start":6000,"end":6000}}
[11:24:06.326] "remote.SSH.serverInstallPath": {"work-main":"/vscode_clean","work-test":"/vscode_sandbox"}
[11:24:06.344] SSH Resolver called for host: second
[11:24:06.345] Setting up SSH remote "second"
[11:24:06.349] Acquiring local install lock: /var/folders/68/j08r_6yx1dbf7h8kbvnhgbhm0000gn/T/vscode-remote-ssh-abf8d4dd-install.lock
[11:24:06.354] Looking for existing server data file at /Users/tanha/Library/Application Support/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-abf8d4dd-e80a0ca648fe9bef07070e4f7fb04e67f2243252-0.77.2022030315/data.json
[11:24:06.355] Using commit id "e80a0ca648fe9bef07070e4f7fb04e67f2243252" and quality "insider" for server
[11:24:06.358] Install and start server if needed
[11:24:06.362] PATH: /Users/tanha/.cargo/bin:/Users/tanha/opt/anaconda3/bin:/Users/tanha/opt/anaconda3/condabin:/Users/tanha/.nvm/versions/node/v15.7.0/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/tanha/bin
[11:24:06.363] Checking ssh with "ssh -V"
[11:24:06.394] > OpenSSH_8.6p1, LibreSSL 2.8.3

[11:24:06.397] askpass server listening on /var/folders/68/j08r_6yx1dbf7h8kbvnhgbhm0000gn/T/vscode-ssh-askpass-d95ef06b2749541e1e38ef1b0a4f77ec91bae957.sock
[11:24:06.398] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/68/j08r_6yx1dbf7h8kbvnhgbhm0000gn/T/vscode-ssh-askpass-d6cbac0687d7eb00c3e61cb5148d7c13816674d0.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50136","-o","ConnectTimeout=15","second","bash"],"serverDataFolderName":".vscode-server-insiders","dataFilePath":"/Users/tanha/Library/Application Support/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-abf8d4dd-e80a0ca648fe9bef07070e4f7fb04e67f2243252-0.77.2022030315/data.json"}
[11:24:06.398] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.0VfjaerL3X/Listeners","SHELL":"/bin/zsh","DISPLAY":"/private/tmp/com.apple.launchd.XbhplmXTDQ/org.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/tanha/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.77.2022030315/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/tanha/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.77.2022030315/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/68/j08r_6yx1dbf7h8kbvnhgbhm0000gn/T/vscode-ssh-askpass-d95ef06b2749541e1e38ef1b0a4f77ec91bae957.sock"}
[11:24:06.399] Spawned 35256
[11:24:06.505] > local-server-1> Spawned ssh, pid=35263
[11:24:06.508] stderr> OpenSSH_8.6p1, LibreSSL 2.8.3
[11:24:06.636] stderr> debug1: Server host key: ssh-ed25519 SHA256:bUQjjyCINrWJMVizfOtSn4vXlohlTPyZZHhhHRXZLjA
[11:24:07.025] Got askpass request: {"request":"root@147.182.250.143's password:"}
[11:24:07.026] Showing password prompt
[11:24:07.027] Listening for interwindow password on /var/folders/68/j08r_6yx1dbf7h8kbvnhgbhm0000gn/T/vscode-ssh-askpass-6456941f5c89651e874f8379b38a0d3f1b16da0f.sock
[11:24:07.027] Writing password prompt to globalState
[11:24:10.677] Got password response
[11:24:10.677] Interactor gave response: ************
[11:24:10.678] Cleaning up other-window auth server
[11:24:10.730] stderr> Authenticated to 147.182.250.143 ([147.182.250.143]:22).
[11:24:12.252] > ready: 5b4bc619e67a
[11:24:12.278] > Linux 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021
[11:24:12.279] Platform: linux
[11:24:12.299] > /usr/bin/fish
[11:24:12.299] Shell: fish
[11:24:12.299] Creating bash subshell inside "fish"
[11:24:12.327] > bash version:  5.0.17(1)-release
[11:24:12.394] > 5b4bc619e67a: running
[11:24:12.474] > Acquiring lock on /root/.vscode-server-insiders/bin/e80a0ca648fe9bef07070e4f7fb04e67f2243252/vscode-remote-lock.root.e80a0ca648fe9bef07070e4f7fb04e67f2243252
[11:24:12.494] > Found old VS Code install 3dda6ea7acb66ea8693032fe9631ccac629da770, attempting to clean up
[11:24:12.535] > Deleting old install from /root/.vscode-server-insiders/bin/3dda6ea7acb66ea8693032fe9631ccac629da770
[11:24:12.754] > Deleting old log file from /root/.vscode-server-insiders/.3dda6ea7acb66ea8693032fe9631ccac629da770.log
> Installing to /root/.vscode-server-insiders/bin/e80a0ca648fe9bef07070e4f7fb04e67f2243252...
> 5b4bc619e67a%%1%%
> Downloading with wget
[11:24:13.060] > Download complete
[11:24:13.065] > 5b4bc619e67a%%2%%
> tar --version:
[11:24:13.067] > tar (GNU tar) 1.30
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[11:24:15.008] > Checking /root/.vscode-server-insiders/.e80a0ca648fe9bef07070e4f7fb04e67f2243252.log and /root/.vscode-server-insiders/.e80a0ca648fe9bef07070e4f7fb04e67f2243252.pid for a running server
> Starting server with command... /root/.vscode-server-insiders/bin/e80a0ca648fe9bef07070e4f7fb04e67f2243252/bin/code-server-insiders --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all   &> "/root/.vscode-server-insiders/.e80a0ca648fe9bef07070e4f7fb04e67f2243252.log" < /dev/null
> printenv:
>     SHELL=/usr/bin/fish
>     PWD=/root
>     LOGNAME=root
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=C.UTF-8
>     VSCODE_AGENT_FOLDER=/root/.vscode-server-insiders
>     SSH_CONNECTION=47.154.27.147 50138 147.182.250.143 22
>     XDG_SESSION_CLASS=user
>     USER=root
>     SHLVL=2
>     XDG_SESSION_ID=4082
>     XDG_RUNTIME_DIR=/run/user/0
>     SSH_CLIENT=47.154.27.147 50138 22
>     XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     OLDPWD=/root/.vscode-server-insiders/bin/e80a0ca648fe9bef07070e4f7fb04e67f2243252
>     _=/usr/bin/printenv
> Spawned remote server: 1907556
> Waiting for server log...
> Waiting for server log...
[11:24:15.009] stderr> rm: cannot remove '/root/.vscode-server-insiders/.e80a0ca648fe9bef07070e4f7fb04e67f2243252.token': No such file or directory
[11:24:15.027] >  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
[11:24:15.063] > 5b4bc619e67a: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==36683==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==381==
> installTime==1802==
> extInstallTime====
> serverStartTime==120==
> connectionToken==a111111a-1111-1aa1-1aaa-a1a111a11a11==
> 5b4bc619e67a: end
[11:24:15.064] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==36683==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/0==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==381==
installTime==1802==
extInstallTime====
serverStartTime==120==
connectionToken==a111111a-1111-1aa1-1aaa-a1a111a11a11==

[11:24:15.064] Remote server is listening on 36683
[11:24:15.064] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":36683},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/0","platform":"linux","connectionToken":"a111111a-1111-1aa1-1aaa-a1a111a11a11"},"downloadTime":381,"installTime":1802,"serverStartTime":120,"installUnpackCode":"success"}
[11:24:15.065] Persisting server connection details to /Users/tanha/Library/Application Support/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-abf8d4dd-e80a0ca648fe9bef07070e4f7fb04e67f2243252-0.77.2022030315/data.json
[11:24:15.069] Starting forwarding server. localPort 50143 -> socksPort 50136 -> remotePort 36683
[11:24:15.070] Forwarding server listening on 50143
[11:24:15.070] Waiting for ssh tunnel to be ready
[11:24:15.071] Tunneled 36683 to local port 50143
[11:24:15.071] Resolved "ssh-remote+second" to "127.0.0.1:50143"
[11:24:15.072] [Forwarding server 50143] Got connection 0
[11:24:15.086] ------




[11:24:15.098] [Forwarding server 50143] Got connection 1
[11:24:15.339] [Forwarding server 50143] Got connection 2

@shardulkumar79
Copy link
Author

Hi tanhakabir,
I am able to connect to ssh server now. Not sure what was the issue. But I still not able to use vscode intellisense feature. Its indexing is not working and right click with "Go to definition" on any function shows "no definition found" even though the function is defined in the same file. go extension and gopl is already installed on server. snap is attached herewith.
2

@tanhakabir
Copy link

@shardulkumar79 looking at your screenshot on the bottom bar there seems to be an error from the Go extension setting up the workspace. I would file an issue with the extension to see why it's not working.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

4 participants