"Connection timed out" error while connecting vscode to gcloud cloud shell - visual-studio-code

I have set up the cloud shell for vscode as given in this document; however it stopped connecting to the remote shell and it was only connected once initially. No VS Code version change happened. Current VSCode version is 1.46.1
Following are the logs thrown -
[13:31:22.078] Log Level: 2
[13:31:22.086] remote-ssh#0.51.0
[13:31:22.086] win32 x64
[13:31:22.093] SSH Resolver called for "ssh-remote+cloud-shell", attempt 1
[13:31:22.094] SSH Resolver called for host: cloud-shell
[13:31:22.094] Setting up SSH remote "cloud-shell"
[13:31:23.942] Using commit id "cd9ea6488829f560dc949a8b2fb789f3cdc05f5d" and quality "stable" for server
[13:31:23.945] Install and start server if needed
[13:31:23.951] Checking ssh with "ssh -V"
[13:31:23.957] Got error from ssh: spawn ssh ENOENT
[13:31:23.958] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[13:31:23.962] Got error from ssh: spawn C:\Windows\System32\OpenSSH\ssh.exe ENOENT
[13:31:23.962] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[13:31:28.385] > OpenSSH_8.3p1, OpenSSL 1.1.1g 21 Apr 2020
[13:31:28.390] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 50396 cloud-shell bash
[13:31:28.412] Terminal shell path: C:\Windows\System32\cmd.exe
[13:31:33.205] >
[13:31:33.206] Got some output, clearing connection timeout
[13:31:54.348] > ssh: connect to host 34.87.29.174 port 6000: Connection timed out
>
[13:31:54.764] "install" terminal command done
[13:31:54.765] Install terminal quit with output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.766] Received install output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.768] Resolver error: The connection timed out
[13:31:54.781] ------

Related

vscode remote-ssh fails

Local: macOS 12.6, vscode1.72.2, remote-ssh v0.90.1 preview
Server: Tencent Cloud Lightweight Server centOS7.6
Server ssh configuration is set: AllowTcpForwarding yes
The local command line ssh connection server can be entered normally.
The error message is:
channel 2: open failed: administratively prohibited: open failed

VSCode | The editor cannot be opened due to an unexpected error

Goal: Get regular Bash and Git in Terminal working for Python projects in Visual Studio Code.
Anytime I launch, I see this error. I cannot open code or use Terminal.
Error Message:
The editor cannot be opened due to an unexpected error: No file system provider found for resource 'vscode-remote://wsl%2Bubuntu/...'
Update: Uninstalled WSL. I no longer have the below old Terminal output.
Terminal:
[2022-06-13 15:53:18.277] Resolving wsl+ubuntu, resolveAttempt: 1
[2022-06-13 15:53:18.361] Starting VS Code Server inside WSL (wsl1)
[2022-06-13 15:53:18.361] Extension version: 0.66.3
[2022-06-13 15:53:18.361] Windows build: 19044. Multi distro support: available. WSL path support: enabled
[2022-06-13 15:53:18.361] No shell environment set or found for current distro.
[2022-06-13 15:53:18.546] WSL daemon log file:
[2022-06-13 15:53:18.548] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2022-06-13 15:53:19.023] Probing result: x86_64
[2022-06-13 15:53:19.024] No server install found in WSL, needs linux-x64
[2022-06-13 15:53:19.024] Downloading server on client side to C:\Users\dabell\AppData\Local\Temp\vscode-remote-wsl\c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5\vscode-server-stable-linux-x64.tar.gz.
[2022-06-13 15:53:19.024] https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:26.719] Unable to download server on client side: Error: Request downloadRequest failed with message: getaddrinfo ENOTFOUND update.code.visualstudio.com. Will try to download on WSL side.
[2022-06-13 15:53:26.721] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=1433349295-3472956524-2784734323-674824766 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2022-06-13 15:53:27.103] Setting up server environment: Looking for /home/danielbellhv/.vscode-server/server-env-setup. Not found.
[2022-06-13 15:53:27.104] WSL version: 4.4.0-19041-Microsoft Ubuntu
[2022-06-13 15:53:27.104] Updating VS Code Server to version c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
[2022-06-13 15:53:27.104] Removing previous installation...
[2022-06-13 15:53:27.104] Installing VS Code Server for x64 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5)
[2022-06-13 15:53:27.104] Downloading:
[2022-06-13 15:53:37.329] 100%
[2022-06-13 15:53:37.329] Failed
[2022-06-13 15:53:37.331] --2022-06-13 16:53:37-- https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:37.331] Resolving update.code.visualstudio.com (update.code.visualstudio.com)...
[2022-06-13 15:53:47.093] failed: Temporary failure in name resolution.
[2022-06-13 15:53:47.093] wget: unable to resolve host address ‘update.code.visualstudio.com’
[2022-06-13 15:53:47.093] ERROR: Failed to download https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable to /home/danielbellhv/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5-1655135606.tar.gz
[2022-06-13 15:53:47.094] VS Code Server for WSL closed unexpectedly.
[2022-06-13 15:53:47.094] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2022-06-13 15:53:47.116] WSL Daemon exited with code 0
This can be solved by restarting the WSL container's network.
Open Powershell from in Windows and type the following command:
Restart-Service LxssManager
I would advise saving it to a script such as restart-WSL-network.ps1 and setting up a shortcut to run this when it happens again.
I'm kind of late to the party, but I've just had this issue today. I only restarted Windows, and now it works fine!
Deleting the .vscode* folders in the home directory (in wsl) fixed the issue
running wsl --shutdown from windows command line and relaunch the vscode solved my issue.
I simply uninstalled and reinstalled WSL 2, from Windows Store.
You can via. command line, but I found using Windows Store to be more accessible / user friendly.

Can't connect remote-ssh VSCode - No Kerberos credentials available

I installed remote-ssh plugin in my VSCode in an Ubuntu machine and I got a problem connecting to the remote server. The password prompt didn't appear and I couldn't enter my ssh passphrase and I suspect that's why the connection failed. Any advice? Thanks
[21:29:18.094] Spawning local server with {"serverId":1,"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-43be30dd59b7e1cc43e3ac15496de2994552e19d.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","34635","-o","ConnectTimeout=15","pipeline-azure-2.nplan.io"],"dataFilePath":"/home/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-pipeline-azure-2.nplan.io-c3f126316369cd610563c75b1b1725e0679adfb3-0.65.7/data.json"}
[21:29:18.094] Local server env: {"DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/snap/code/70/usr/share/code/code","VSCODE_SSH_ASKPASS_MAIN":"/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-4ae6bcfc1164348347c6920b3ec572ba3eba795f.sock"}
[21:29:18.105] Spawned 239369
[21:29:18.301] > local-server-1> Spawned ssh, pid=239378
[21:29:18.305] stderr> OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020
[21:29:23.099] stderr> debug1: Server host key: ssh-rsa SHA256:BJdFW33L3iusC5rckbrC9WmH7+dx5W1mC6VkyAsCFbs
[21:29:33.762] stderr> No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
[21:29:33.762] stderr>
[21:29:33.762] stderr>
[21:29:35.107] Terminating local server
[21:29:35.111] Resolver error: Error: Connecting with SSH timed out
at Function.Timeout (/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:64785)
at Timeout._onTimeout (/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:264709)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
[21:29:35.124] ------
I just deleted the .vscode-server folder on the server and voila!
Credits to: https://github.com/microsoft/vscode-remote-release/issues/3856#issuecomment-710733921

remote ssh connection failed with this error message in output of vscode (I'm connecting from linux server 18 to mac using ssh extension)

[12:03:55.917] Log Level: 2
[12:03:55.919] remote-ssh#0.61.0
[12:03:55.919] darwin x64
[12:03:55.921] SSH Resolver called for "ssh-remote+192.168.0.108", attempt 1
[12:03:55.921] "remote.SSH.useLocalServer": true
[12:03:55.921] "remote.SSH.sshPath": ssh
[12:03:55.921] "remote.SSH.sshConfigurationFile": /Users/apple/.ssh/config
[12:03:55.922] "remote.SSH.useFlock": true
[12:03:55.922] "remote.SSH.lockfilesInTmp": true
[12:03:55.922] "remote.SSH.localServerDownload": auto
[12:03:55.922] "remote.SSH.remoteServerListenOnSocket": false
[12:03:55.922] "remote.SSH.showLoginTerminal": true
[12:03:55.922] "remote.SSH.maxReconnectionAttempts": 9007199254740991
[12:03:55.923] SSH Resolver called for host: 192.168.0.108
[12:03:55.923] Setting up SSH remote "192.168.0.108"
[12:03:55.926] Acquiring local install lock:
/var/folders/8g/jfn_yxnn63j718q8_f2fkrw00000gn/T/vscode-remote-ssh-192.168.0.108-
install.lock
[12:03:55.948] Looking for existing server data file at /Users/apple/Library/Application
Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-192.168.0.108-
940b5f4bb5fa47866a54529ed759d95d09ee80be-0.61.0/data.json
[12:03:55.952] Using commit id "940b5f4bb5fa47866a54529ed759d95d09ee80be" and quality
"stable" for server
[12:03:55.971] Install and start server if needed
[12:03:55.982] Checking ssh with "ssh -V"
[12:03:56.032] > OpenSSH_7.9p1, LibreSSL 2.7.3
[12:03:56.035] Using SSH config file "/Users/apple/.ssh/config"
[12:03:56.036] askpass server listening on
/var/folders/8g/jfn_yxnn63j718q8_f2fkrw00000gn/T/vscode-ssh-askpass-
a053265c1873c60f803ede861fc6322c4ed520cd.sock
[12:03:56.037] Spawning local server with
{"ipcHandlePath":"/var/folders/8g/jfn_yxnn63j718q8_f2fkrw00000gn/T/vscode-ssh-askpass-
220be0bb451b619d8ebcba60f7b13b9801f559f3.sock","sshCommand":"ssh","sshArgs":["-v","-T","-
D","50504","-o","ConnectTimeout=15","-
F","/Users/apple/.ssh/config","192.168.0.108"],"dataFilePath":"/Users/apple/Library/Application
Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-192.168.0.108-
940b5f4bb5fa47866a54529ed759d95d09ee80be-0.61.0/data.json"}
[12:03:56.037] Local server env:
{"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/apple/.vscode/extensions/ms-
vscode-remote.remote-ssh-0.61.0/out/local-
server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Users/apple/Desktop/Visual Studio
Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper.
(Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/apple/.vscode/extensions/ms-vscode-
remote.remote-ssh-0.61.0/out/askpass-
ssh-askpass-a053265c1873c60f803ede861fc6322c4ed520cd.sock"}
[12:03:56.041] Spawned 3077
[12:03:56.217] > local-server> Spawned ssh: 3078
[12:03:56.241] stderr> OpenSSH_7.9p1, LibreSSL 2.7.3
[12:03:56.266] stderr> Connection reset by 192.168.0.108 port 22
[12:03:56.268] > local-server> ssh child died, shutting down
[12:03:56.275] Local server exit: 0
[12:03:56.275] Received install output: OpenSSH_7.9p1, LibreSSL 2.7.3
Connection reset by 192.168.0.108 port 22
[12:03:56.276] Stopped parsing output early. Remaining text: OpenSSH_7.9p1, LibreSSL
2.7.3Connection reset by 192.168.0.108 port 22
[12:03:56.276] Failed to parse remote port from server output
[12:03:56.283] Resolver error: Error:
at Function.Create (/Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:1:82322)
at Object.t.handleInstallOutput (/Users/apple/.vscode/extensions/ms-vscode-
remote.remote-ssh-0.61.0/out/extension.js:1:78935)
at Object.t.tryInstallWithLocalServer (/Users/apple/.vscode/extensions/ms-vscode-
remote.remote-ssh-0.61.0/out/extension.js:127:102434)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async /Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:127:104499
at async Object.t.withShowDetailsEvent (/Users/apple/.vscode/extensions/ms-vscode-
remote.remote-ssh-0.61.0/out/extension.js:127:110308)
at async /Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:127:100987
at async S (/Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:127:97777)
at async Object.t.resolveWithLocalServer (/Users/apple/.vscode/extensions/ms-vscode-
remote.remote-ssh-`0.61.0`/out/extension.js:127:100636)
at async Object.t.resolve (/Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:127:108250)
at async /Users/apple/.vscode/extensions/ms-vscode-remote.remote-ssh-
0.61.0/out/extension.js:127:129627
[12:03:56.289] ------

Successfully installed vs code server on remote host, but it's still trying to install something

I have successfully installed vs code server on the remote host following the steps here SSH with VSCode without internet.
Now when I ssh into the remote host, I can connect successfully and start working, but in the install terminal, it's still trying to install something, not sure if it's an extension on the remote host that I wanted to install earlier and later successfully installed with vsix. See the log from remote - ssh below, further down there's also output from the install terminal which shows a small bar moving, seemingly indicating progress of something.
How can I stop it from doing this every time I connect to the host? Thank you!!
[11:58:58.011] remote-ssh-nightly#2019.10.9540
[11:58:58.011] win32 x64
[11:58:58.013] SSH Resolver called for "ssh-remote+<hostname>", attempt 1
[11:58:58.013] SSH Resolver called for host: <hostname>
[11:58:58.013] Setting up SSH remote "<hostname>"
[11:58:58.028] Using commit id "<mycommitid>" and quality "stable" for server
[11:58:58.029] Testing ssh with ssh -V
[11:58:58.287] ssh exited with code: 0
[11:58:58.287] Got stderr from ssh: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[11:58:58.290] Running script with connection command: ssh -T -D 61671 <hostname> bash
[11:58:58.292] Install and start server if needed
[11:58:58.295] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:58:58.639] >
[11:58:58.639] Got some output, clearing connection timeout
[11:58:59.616] > 6c2c07692b2a: running
>
[11:58:59.677] > Acquiring lock on /users/<myuserid>/.vscode-server/bin/<mycommitid>/vscode-remote-lock.<mycommitid>
> Found existing installation at /users/<myuserid>/.vscode-server/bin/<mycommitid>...
>
[11:58:59.718] > Found running server...
>
> *
> * 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:58:59.739] > Checking server status on port 32772 with wget
> 6c2c07692b2a: start
> sshAuthSock====
> agentPort==32772==
> webViewServerPort====
> osReleaseId==centos==
> arch==x86_64==
> webUiAccessToken====
> 6c2c07692b2a: end
>
[11:58:59.739] Received install output:
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
[11:58:59.740] Remote server is listening on port 32772
[11:58:59.740] Parsed server configuration: {"agentPort":32772,"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":""}
[11:58:59.741] Starting forwarding server. localPort 61674 -> socksPort 61671 -> remotePort 32772
[11:58:59.742] Forwarding server listening on 61674
[11:58:59.742] Waiting for ssh tunnel to be ready
[11:58:59.750] [Forwarding server 61674] Got connection 0
[11:58:59.755] Tunneled remote port 32772 to local port 61674
[11:58:59.756] Resolved "ssh-remote+<hostname>" to "127.0.0.1:61674"
[11:58:59.756] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"success","osReleaseId":"centos","arch":"x86_64","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0"},"measures":{"resolveAttempts":1,"retries":1}}
[11:58:59.756] ------
[11:58:59.784] [Forwarding server 61674] Got connection 1
[11:58:59.789] [Forwarding server 61674] Got connection 2
[12:01:59.722] >
[12:04:59.733] >
[12:07:59.744] >
Below is the output on the install terminal. At the end of this output, there's a small bar moving very slowly like a progress bar.
6c2c07692b2a: running
Acquiring lock on /users/<myuserid>/.vscode-server/bin/<commitid>/vscode-remote-lock.<commitid>
Found existing installation at /users/<myuserid>/.vscode-server/bin/<commitid>...
Found running server...
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*
Checking server status on port 32772 with wget
6c2c07692b2a: start
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
6c2c07692b2a: end