microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 292 forks source link

Stuck on Connecting to [server] #10191

Closed mdonato-fn closed 2 months ago

mdonato-fn commented 2 months ago

Edit: solved by removing /var/folders/q5/somethingsomething/T/vscode-tunneling-somethingsomething.sock from the client and restarting everything.

Not sure what is happening here, yesterday all was good.

I updated the cli, checked for updates for extension and client, removed the .vscode/cli directory to see if there was something hanging in there with "connecting to..."

Also when trying to connect to https://vscode.dev/tunnel/servername, everything works

I can connect to the server via kubectl (it's in a pod somewhere) from the terminal

2024-08-27 11:22:02.081 [info] Resolving tunnel+freenotes...
2024-08-27 11:22:02.083 [info] Found running server in /var/folders/q5/somethingsomething/T/vscode-tunneling-somethingsomethingsock
2024-08-27 11:22:02.085 [info] Remote resolution completed
2024-08-27 11:22:02.860 [info] [proxy] Found tunnel (ID=an_id, Cluster=usw3)

On the server side:

*
* 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).
*
[2024-08-27 18:31:10] debug Starting tunnel with `code ./Software/code tunnel --verbose --name freenotes`
[2024-08-27 18:31:10] debug starting as new singleton
[2024-08-27 18:31:10] debug Using file keychain storage due to: user prefers file storage: 
[2024-08-27 18:31:10] trace Found token in keyring
[2024-08-27 18:31:10] debug [reqwest::connect] starting new connection: https://api.github.com/
[2024-08-27 18:31:10] debug [reqwest::connect] starting new connection: https://usw3.rel.tunnels.api.visualstudio.com/
[2024-08-27 18:31:10] debug Starting tunnel to server...
[2024-08-27 18:31:10] trace Found token in keyring
[2024-08-27 18:31:11] debug [tungstenite::handshake::client] Client handshake done.
[2024-08-27 18:31:11] debug [russh::ssh_read] read_ssh_id: reading
[2024-08-27 18:31:11] debug [russh::ssh_read] read 39
[2024-08-27 18:31:11] debug [russh::ssh_read] Ok("SSH-2.0-Microsoft.DevTunnels.Ssh_3.11\r\n")
[2024-08-27 18:31:11] debug [russh::client] writing 352 bytes
[2024-08-27 18:31:11] debug [russh::ssh_read] id 39 39
[2024-08-27 18:31:11] debug [russh::client::kex] extending []
[2024-08-27 18:31:11] debug [russh::client::kex] algo = Names { kex: Name("none"), key: Name("none"), cipher: Name("none"), client_mac: Name("none"), server_mac: Name("none"), server_compression: None, client_compression: None, ignore_guessed: false }
[2024-08-27 18:31:11] debug [russh::client::kex] write = []
[2024-08-27 18:31:11] debug [russh::client::kex] i0 = 342
[2024-08-27 18:31:11] debug [russh::client::kex] moving to kexdhdone, exchange = Exchange { client_id: CryptoVec { p: not_sure_I_should_leave_it, size: 20, capacity: 32 }, server_id: CryptoVec { p: not_sure_I_should_leave_it, size: 37, capacity: 64 }, client_kex_init: CryptoVec { p: not_sure_I_should_leave_it, size: 342, capacity: 512 }, server_kex_init: CryptoVec { p: not_sure_I_should_leave_it, size: 94, capacity: 128 }, client_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 }, server_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 } }
[2024-08-27 18:31:11] debug [tunnels::connections::relay_tunnel_host] established host relay primary session
[2024-08-27 18:31:11] trace Found token in keyring
[2024-08-27 18:31:11] debug Connected to tunnel endpoint: TunnelRelayTunnelEndpoint { base: TunnelEndpoint { id: "a_host_id-relay", connection_mode: TunnelRelay, host_id: "a_host_id", host_public_keys: [], port_uri_format: Some("https://an_id-{port}.usw3.devtunnels.ms/"), tunnel_uri: Some("https://an_id.usw3.devtunnels.ms/"), port_ssh_command_format: Some("ssh an_id-{port}@ssh.usw3.devtunnels.ms"), tunnel_ssh_command: Some("ssh an_id@ssh.usw3.devtunnels.ms"), ssh_gateway_public_key: None }, host_relay_uri: Some("wss://usw3-data.rel.tunnels.api.visualstudio.com/api/v1/Host/Connect/an_id"), client_relay_uri: Some("wss://usw3-data.rel.tunnels.api.visualstudio.com/api/v1/Client/Connect/an_id") }
[2024-08-27 18:31:11] debug Visual Studio Code Server is listening for incoming connections

Open this link in your browser https://vscode.dev/tunnel/servername

[2024-08-27 18:31:11] trace Found token in keyring
[2024-08-27 18:31:11] debug [reqwest::connect] starting new connection: https://api.github.com/
[2024-08-27 18:32:11] debug [tunnels::connections::ws] sent liveness ping
[2024-08-27 18:32:11] debug [tunnels::connections::ws] received liveness pong
[2024-08-27 18:33:11] debug [tunnels::connections::ws] received liveness pong

Steps to Reproduce:

  1. Start server with ./code --tunnel --verbose
  2. Use client extension to find tunnel (shows as running) and connect to it

Does this issue occur when you try this locally?: NA Does this issue occur when you try this locally and all extensions are disabled?: NA

connor4312 commented 2 months ago

Hi, to clarify are you saying the connecting from vscode.dev works, but connecting from a desktop VS Code client doesn't?

mdonato-fn commented 2 months ago

Correct: I can get vs code in the browser, but nothing from the client

mdonato-fn commented 2 months ago

alright I solved it.

I tried to connect this morning hoping that it was one of those cases where "just wait a day or two" works, but it was not

So I looked again at the message:

Found running server in /var/folders/q5/somethingsomething/T/vscode-tunneling-somethingsomething.sock

I thought that would be some running server on the host, but I looked into /var/folders/q5/somethingsomething/T/ and the file was there.

I shut down vs code, removed the file, re-started, and it worked.

In hindsight I should have tried to connect with another machine