Closed majaroonie closed 2 years ago
Could you please share with me your Remote-SSH logs from the Output tab?
Sure thing. The error seen in the log is:
Failed to set up socket for dynamic port forward to remote port 35133: Socket closed. Is the remote port correct?
Could you attach the logs following these instructions? https://code.visualstudio.com/docs/remote/troubleshooting#_reporting-issues
I ran into the same issue, and I tried to follow the instruction to get remote-ssh show log output, it does not show any log we are looking for.
However, from console output I am seeing the following error messages,
INFO Invoking resolveAuthority(ssh-remote)
log.ts:301 INFO resolveAuthority(ssh-remote) returned '127.0.0.1:58125' after 3870 ms
log.ts:313 ERR [Extension Host] (node:37396) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Electron --trace-deprecation ...` to show where the warning was created)
console.ts:137 [Extension Host] (node:37396) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use `Electron --trace-deprecation ...` to show where the warning was created)
I @ console.ts:137
browserSocketFactory.ts:79 WebSocket connection to 'ws://127.0.0.1:58125/?reconnectionToken=d21b3e6c-1cba-4d69-bef7-55cfb4b22bce&reconnection=false&skipWebSocketFrames=false' failed:
E @ browserSocketFactory.ts:79
log.ts:313 ERR [remote-connection][Management ][d21b3…][initial][127.0.0.1:58125] socketFactory.connect() failed or timed out. Error:
log.ts:313 ERR Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611)
log.ts:313 ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
3log.ts:313 ERR Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611)
log.ts:313 ERR Cannot register remote filesystem provider. Error while fetching remote environment. WebSocket close with status code 1006
notificationsAlerts.ts:42 Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
onDidChangeNotification @ notificationsAlerts.ts:42
log.ts:313 ERR Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611)
notificationsAlerts.ts:42 Could not fetch remote environment
onDidChangeNotification @ notificationsAlerts.ts:42
log.ts:313 ERR WebSocket close with status code 1006: Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611:39219)
log.ts:313 ERR Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611)
TMScopeRegistry.ts:45 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.macro.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json.
New grammar file: file:///Users/dtung/.vscode/extensions/jeff-hykin.better-cpp-syntax-1.15.13/autogenerated/cpp.embedded.macro.tmLanguage.json
register @ TMScopeRegistry.ts:45
TMScopeRegistry.ts:45 Overwriting grammar scope name to file mapping for scope source.cpp.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/cpp/syntaxes/cpp.tmLanguage.json.
New grammar file: file:///Users/dtung/.vscode/extensions/jeff-hykin.better-cpp-syntax-1.15.13/autogenerated/cpp.tmLanguage.json
register @ TMScopeRegistry.ts:45
log.ts:313 ERR WebSocket close with status code 1006: Error: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:611:39219)
console.ts:137 [Extension Host] [vscode-icons] v11.10.0 activated!
@dayuantung did you try to connect to your remote first and then look for the logs? I'm sorry the Remote SSH logs are the most helpful for me to debug with
@tanhakabir yes, here are the steps I did to isolate,
[11:25:17.209] Log Level: 2
[11:25:17.210] remote-ssh@0.76.1
[11:25:17.210] darwin x64
[11:25:17.213] SSH Resolver called for "ssh-remote+<I MASKED THIS HOSTNAME>", attempt 1
[11:25:17.213] "remote.SSH.useLocalServer": true
[11:25:17.214] "remote.SSH.path": undefined
[11:25:17.214] "remote.SSH.configFile": undefined
[11:25:17.214] "remote.SSH.useFlock": true
[11:25:17.214] "remote.SSH.lockfilesInTmp": false
[11:25:17.214] "remote.SSH.localServerDownload": auto
[11:25:17.214] "remote.SSH.remoteServerListenOnSocket": false
[11:25:17.214] "remote.SSH.showLoginTerminal": false
[11:25:17.215] "remote.SSH.defaultExtensions": []
[11:25:17.215] "remote.SSH.loglevel": 2
[11:25:17.217] "remote.SSH.enableDynamicForwarding": true
[11:25:17.217] "remote.SSH.enableRemoteCommand": false
[11:25:17.217] "remote.SSH.serverPickPortsFromRange": {}
[11:25:17.217] "remote.SSH.serverInstallPath": {}
[11:25:17.227] SSH Resolver called for host: <I MASKED THIS HOSTNAME>
[11:25:17.228] Setting up SSH remote "<I MASKED THIS HOSTNAME>"
[11:25:17.231] Acquiring local install lock: /var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-remote-ssh-74ce345a-install.lock
[11:25:17.233] Looking for existing server data file at /Users/dtung/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-74ce345a-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json
[11:25:17.235] Found local server running: {"remoteListeningOn":{"port":42723},"osReleaseId":"rhel","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-wmBVMI2P0ZGH/agent.40151","display":"sjc-xdm-018:1.0","tmpDir":"/run/user/44414","platform":"linux","connectionToken":"1aa11a11-1a11-1a11-a111-1aa1111111aa","pid":37401,"ipcHandlePath":"/var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-220b9f0ad36247acf25d8ae9461237fd7c432a08.sock","socksPort":58118,"startupTime":1646679057704}
[11:25:17.238] Server delay-shutdown request failed: connect ECONNREFUSED /var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-220b9f0ad36247acf25d8ae9461237fd7c432a08.sock
[11:25:17.238] Existing server's health check failed, will start a new one
[11:25:17.238] Using commit id "b5205cc8eb4fbaa726835538cd82372cc0222d43" and quality "stable" for server
[11:25:17.242] Install and start server if needed
[11:25:17.250] PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:/opt/X11/bin:/usr/local/bin/jamf:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/Users/dtung/Library/Python/3.7/bin
[11:25:17.250] Checking ssh with "ssh -V"
[11:25:17.259] > OpenSSH_8.6p1, LibreSSL 2.8.3
[11:25:17.262] askpass server listening on /var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-e4f8ba05fe130df34db461dbfd1573b31bf0fbdd.sock
[11:25:17.262] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-0dc069b57acfae5e0cccecfe7b1d119ce8cd6ba4.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","60695","-o","ConnectTimeout=15","<I MASKED THIS HOSTNAME>"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/dtung/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-74ce345a-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json"}
[11:25:17.262] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.VFX5oRjYjy/Listeners","SHELL":"/bin/zsh","DISPLAY":"/private/tmp/com.apple.launchd.AZvlRAu3UB/org.macosforge.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/dtung/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/dtung/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-e4f8ba05fe130df34db461dbfd1573b31bf0fbdd.sock"}
[11:25:17.263] Spawned 42774
[11:25:17.385] > local-server-1> Spawned ssh, pid=42777
[11:25:17.389] stderr> OpenSSH_8.6p1, LibreSSL 2.8.3
[11:25:17.444] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:yB7fr+2kPfGvC7hhxl9F010qhvhPWQj3c/Sl/KX9fQE
[11:25:17.510] stderr>
[11:25:17.510] stderr> WARNING!!!
[11:25:17.510] stderr> READ THIS BEFORE ATTEMPTING TO LOGON
[11:25:17.510] stderr>
[11:25:17.510] stderr> This System is for the use of authorized users only. Individuals
[11:25:17.510] stderr> using this computer without authority, or in excess of their
[11:25:17.510] stderr> authority, are subject to having all of their activities on this
[11:25:17.510] stderr> system monitored and recorded by system personnel. In the course
[11:25:17.511] stderr> of monitoring individuals improperly using this system, or in the
[11:25:17.511] stderr> course of system maintenance, the activities of authorized users
[11:25:17.511] stderr> may also be monitored. Anyone using this system expressly
[11:25:17.511] stderr> consents to such monitoring and is advised that if such
[11:25:17.511] stderr> monitoring reveals possible criminal activity, system personnel
[11:25:17.511] stderr> may provide the evidence of such monitoring to law enforcement
[11:25:17.511] stderr> officials.
[11:25:17.511] stderr>
<I MASKED THIS HOSTNAME>
[11:25:17.511] stderr>
[11:25:17.705] Got askpass request: {"request":"Enter passphrase for key '/Users/dtung/.ssh/id_rsa':"}
[11:25:17.705] Detected passphrase message
[11:25:17.707] Listening for interwindow password on /var/folders/22/kvsk_4811cng_zk5r_60chbr0000gn/T/vscode-ssh-askpass-6c7111ec9ddd28e7ab8a2e3ae39afc9faef123db.sock
[11:25:17.707] Writing password prompt to globalState
[11:25:19.496] Got passphrase response
[11:25:19.496] Interactor gave response: ********
[11:25:19.497] Cleaning up other-window auth server
[11:25:19.774] stderr> Authenticated to <I MASKED THIS HOSTNAME> ([171.68.222.54]:22).
[11:25:19.970] > ready: 7c44181a2d96
[11:25:19.977] > Linux 3.10.0-1160.31.1.el7.x86_64 #1 SMP Wed May 26 20:18:08 UTC 2021
[11:25:19.977] Platform: linux
[11:25:19.984] > /bin/bash
[11:25:19.984] Shell: bash
[11:25:20.004] > 7c44181a2d96: running
[11:25:20.042] > Acquiring lock on /users/dtung/.vscode-server/bin/b5205cc8eb4fbaa726835538cd82372cc0222d43/vscode-remote-lock.dtung.b5205cc8eb4fbaa726835538cd82372cc0222d43
[11:25:20.050] > Found existing installation at /users/dtung/.vscode-server/bin/b5205cc8eb4fbaa726835538cd82372cc0222d43...
> Checking /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.log and /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.pid for a running server
[11:25:20.057] > Looking for server with pid: 101323
[11:25:20.085] > Starting server with command... /users/dtung/.vscode-server/bin/b5205cc8eb4fbaa726835538cd82372cc0222d43/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all &> "/users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.log" < /dev/null
> printenv:
[11:25:20.087] > NNTPSERVER=<I MASKED THIS HOSTNAME>
> MANPATH=/opt/quest/man::/opt/puppetlabs/puppet/share/man:/usr/man:/man:/sw/current/man:/users/dtung/ats4.0/man:/users/dtung/man
> SSH_AGENT_PID=40152
> XDG_SESSION_ID=9406
> HOSTNAME=sjc-ads-8515
> CLEARTOOL=/usr/atria/bin/cleartool
> SHELL=/bin/bash
> HISTSIZE=10000
> SSH_CLIENT=10.21.68.147 60697 22
> PERL5LIB=/users/dtung/perl5/lib/perl5
> HEX_DEBUG=1
> TFTPHOST=dirt
> QTDIR=/usr/lib64/qt-3.3
> OLDPWD=/users/dtung
> QTINC=/usr/lib64/qt-3.3/include
> PERL_MB_OPT=--install_base "/users/dtung/perl5"
> QT_GRAPHICSSYSTEM_CHECKED=1
> USER=dtung
> LD_LIBRARY_PATH=/lib:/usr/lib
> SUDO_PROMPT=Enter RADIUS password (http://otp for help):
> QDDTS=<I MASKED THIS HOSTNAME>
> SSH_AUTH_SOCK=/tmp/ssh-wmBVMI2P0ZGH/agent.40151
> SJC_TFTP=/auto/tftp-sjc-users1/dtung
> PAGER=less -g
> VSCODE_AGENT_FOLDER=/users/dtung/.vscode-server
> TFTPDIR=/ws/dtung-sjc
> KEYCHAIN=<I MASKED THIS HOSTNAME>
> MAIL=/var/spool/mail/dtung
> PATH=/opt/teambuilder/bin::/usr/<I MASKED THIS HOSTNAME>/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/etc:/auto/asic-tools/bin:.:/users/dtung/bin:/ws/dtung-sjc/packages/bin:/users/dtung/.fzf/bin
> PWD=/users/dtung
> BASH_ENV_SET=1
> EDITOR=/usr/<I MASKED THIS HOSTNAME>/bin/vim
> LANG=en_US.UTF-8
> KDEDIRS=/usr
> OS_VER=3.10.0-1160.31.1.el7.x86_64
> HISTCONTROL=erasedups
> SHLVL=1
> HOME=/users/dtung
> PERL_LOCAL_LIB_ROOT=/users/dtung/perl5
> MY_TFTP=/auto/tftpboot-sys/dtung/tftp
> LOGNAME=dtung
> CTO_GITHUB_TOKEN=952af9c6d578e5e9f73296039fcc098cace7ec8d
> VISUAL=/usr/<I MASKED THIS HOSTNAME>/bin/vim
> PRINTER=sjc18-03-c2-08-mx,duplex
> QTLIB=/usr/lib64/qt-3.3/lib
> CVS_RSH=ssh
> CLASSPATH=.
> XDG_DATA_DIRS=/users/dtung/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
> SSH_CONNECTION=10.21.68.147 60697 171.68.222.54 22
> FZF_DEFAULT_COMMAND=rg --files --hidden --follow --glob "!.git/*"
> LESSOPEN=||/usr/bin/lesspipe.sh %s
> LPDEST=sjc18-03-c2-08-mx,duplex
> ACME_DIFF_OPTS=--show-c-function
> DISPLAY=sjc-xdm-018:1.0
> XDG_RUNTIME_DIR=/run/user/44414
> QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
> PERL_MM_OPT=INSTALL_BASE=/users/dtung/perl5
> _=/bin/printenv
[11:25:20.101] stderr> -bash: line 497: /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.token: cannot overwrite existing file
[11:25:20.102] > Removing old logfile at /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.log
[11:25:20.104] > Spawned remote server: 3038
[11:25:20.104] stderr> -bash: line 513: /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.pid: cannot overwrite existing file
[11:25:20.106] stderr> cat: /users/dtung/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.log: No such file or directory
[11:25:20.107] > Waiting for server log...
[11:25:20.143] > Waiting for server log...
[11:25:20.178] > Waiting for server log...
[11:25:20.217] >
> *
> * 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:25:20.220] > 7c44181a2d96: start
> SSH_AUTH_SOCK==/tmp/ssh-wmBVMI2P0ZGH/agent.40151==
[11:25:20.225] > DISPLAY==sjc-xdm-018:1.0==
> webUiAccessToken====
> listeningOn==41417==
> osReleaseId==rhel==
> arch==x86_64==
> tmpDir==/run/user/44414==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime==125==
> connectionToken==1a11a11a-11aa-11a1-1aa1-a1aaa1a1a111==
> 7c44181a2d96: end
[11:25:20.225] Received install output:
SSH_AUTH_SOCK==/tmp/ssh-wmBVMI2P0ZGH/agent.40151==DISPLAY==sjc-xdm-018:1.0==
webUiAccessToken====
listeningOn==41417==
osReleaseId==rhel==
arch==x86_64==
tmpDir==/run/user/44414==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==125==
connectionToken==1a11a11a-11aa-11a1-1aa1-a1aaa1a1a111==
[11:25:20.225] Remote server is listening on 41417
[11:25:20.226] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":41417},"osReleaseId":"rhel","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-wmBVMI2P0ZGH/agent.40151","display":"sjc-xdm-018:1.0","tmpDir":"/run/user/44414","platform":"linux","connectionToken":"1a11a11a-11aa-11a1-1aa1-a1aaa1a1a111"},"serverStartTime":125,"installUnpackCode":""}
[11:25:20.236] Persisting server connection details to /Users/dtung/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-74ce345a-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json
[11:25:20.238] Starting forwarding server. localPort 60701 -> socksPort 60695 -> remotePort 41417
[11:25:20.239] Forwarding server listening on 60701
[11:25:20.239] Waiting for ssh tunnel to be ready
[11:25:20.249] Tunneled 41417 to local port 60701
[11:25:20.250] Resolved "ssh-remote+<I MASKED THIS HOSTNAME>" to "127.0.0.1:60701"
[11:25:20.250] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-wmBVMI2P0ZGH/agent.40151" "/run/user/44414/vscode-ssh-auth-sock-566568697"
[11:25:20.250] Using cwd: vscode-remote://ssh-remote%2B<I MASKED THIS HOSTNAME>/
[11:25:20.250] Remote extension host environment: {"SSH_AUTH_SOCK":"/run/user/44414/vscode-ssh-auth-sock-566568697","DISPLAY":"sjc-xdm-018:1.0"}
[11:25:20.252] [Forwarding server 60701] Got connection 0
[11:25:20.256] ------
[11:25:20.278] [Forwarding server 60701] Got connection 1
[11:25:20.443] [Forwarding server 60701] Got connection 2
[11:25:20.460] Failed to set up socket for dynamic port forward to remote port 41417: Socket closed. Is the remote port correct?
Sorry for the late reply. Do you have TCP port forwarding enabled on your remote machine?
I just checked, I don't know if remote machine has TCP port forwarding enabled because I can't get to the sshd config (controlled by IT). My assumption is probably yes, it is enabled. With extension 0.74.0, there is a tab call "Ports", and I don't see any ports available there. However, I remember in the older extension version I saw some messages about setting up forwarding ports. Don't know if these little pieces can help, please let me know what else I can try to find out more for your investigation.
@dayuantung as a sanity check did you try connecting with the pre-release version of the extension? 0.77.X
@tanhakabir sorry I missed your message, I just checked v0.77.2022031115 and it seems to be working ok for me. Thanks!
System: Mac OS 12.2.1, Intel Core i5 Visual Code Studio Version: 1.64.2
Errors appear when trying to connect to remote server. When I downgrade to 0.74.0, it connects and works as usual.