vscode: Cannot connect to a Remote Tunnel for a second time from local vscode

Does this issue occur when all extensions are disabled?: The remote tunnel extension is needed

  • VS Code Version: 1.74.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Set up tunneling on machine 1
  2. Connect from local vscode in machine 2 to machine 1
  3. Close remote from machine 2
  4. Connect again from local vscode in machine 2 to machine 1

The following can be seen in machine 1 terminal: [2022-12-10 17:35:05] info [rpc.6] Found running server (pid=3124) [2022-12-10 17:35:15] info [rpc.6] Forwarding port 5555 [2022-12-10 17:35:41] info [rpc.6] Disposed of connection to running server. [2022-12-10 17:38:37] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2

And it never establishes the connection

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 33 (7 by maintainers)

Most upvoted comments

Same here : vstunnel connects once, then it won’t reconnect until I restart code tunnel.

Same here. Restarting can be a workaround, but it’s a bit annoying.

I’ve had some good luck and some bad luck using the Remote Tunnels across recent updates of the Insiders edition. I think, however, I have found a consistent way to cause this error for me:

After opening a connection from A to B, I start a Jupyter server running on 127.0.0.1 of machine B. VS Code conveniently forwards Jupyter’s :8888 port over the tunnel and allows me to connect the kernel to the files I’m working on. This works for a couple hours, but consistently this configuration will fail after a few hours.

I was just doing this today and briefly lost connection… After trying to reconnect to the remote machine, my local machine is just hanging on "Connecting to… ". Restarting the app on the remote machine or turning remote tunnels off/on always fixes the issue.

Previously, I have noticed the tunnel remaining active and connectable for several days at a time. But as I started working on a notebook today over the tunnel, that is when the tunnel lost connection.

If it helps. My situation is very similar, it happens when I start a TensorBoard server in port 6006 and the port is forwarded by the tunnel.

Seems to be working when I tried recently. @connor4312, thank you for looking into this! You’ve resolved a huge headache for me

Same here. MacOS client to Linux host. I’ve wasted months trying to connect a computer 6 inches away from another. Both of which I paid for.

I’m suffering from this issue too, I cannot even reconnect from the web interface

Still getting Error: WebSocket close with status code 1006 on second connection for both the pre-release version of the Remote Tunnels extension (v1.2.2023042609) and release version (v1.1.0) as of today. https://vscode.dev/tunnel still works, where I can issue code tunnel restart. However, it doesn’t seem to be effective in allowing the local VSCode install to reconnect even after restarting VSCode.

EDIT: Seems intermittent. Was able to connect via local instance after opening the same workspace/folder via vscode.dev, but I don’t think they are correlated.