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

improve the content of the tunnel service console window #181804

Closed
aeschli opened this issue May 8, 2023 · 3 comments
Closed

improve the content of the tunnel service console window #181804

aeschli opened this issue May 8, 2023 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) remote-tunnel

Comments

@aeschli
Copy link
Contributor

aeschli commented May 8, 2023

On Windows
Version: 1.79.0-insider (user setup)
Commit: 7da907e
Date: 2023-05-03T13:27:26.314Z
OS: Windows_NT x64 10.0.22624

  • enable the tunnel service (code tunnel service install)
  • restart your machine
  • a console window appears with output from the service that has started in the background

It contains a lot of debug output, and it's unclear what it is about

  • show relevant infomation such as 'starting tunnel service'
  • start the service on the home folder (currently system32)
[2023-05-08 11:43:46] debug starting as new singleton
[2023-05-08 11:43:46] trace Found token in keyring
[2023-05-08 11:43:46] debug [reqwest::connect] starting new connection: https://api.github.com/
[2023-05-08 11:43:47] debug [reqwest::connect] starting new connection: https://uks1.rel.tunnels.api.visualstudio.com/
[2023-05-08 11:43:48] trace Found token in keyring
[2023-05-08 11:43:48] debug Starting tunnel to server...
[2023-05-08 11:43:48] trace Found token in keyring
[2023-05-08 11:43:49] debug [tungstenite::handshake::client] Client handshake done.
[2023-05-08 11:43:49] debug [russh::ssh_read] read_ssh_id: reading
[2023-05-08 11:43:49] debug [russh::ssh_read] read 39
[2023-05-08 11:43:49] debug [russh::ssh_read] Ok("SSH-2.0-Microsoft.DevTunnels.Ssh_3.11\r\n")
[2023-05-08 11:43:49] debug [russh::client] writing 352 bytes
[2023-05-08 11:43:49] debug [russh::ssh_read] id 39 39
[2023-05-08 11:43:49] debug [russh::client::kex] extending []
[2023-05-08 11:43:49] 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 }
[2023-05-08 11:43:49] debug [russh::client::kex] write = []
[2023-05-08 11:43:49] debug [russh::client::kex] i0 = 342
[2023-05-08 11:43:49] debug [russh::client::kex] moving to kexdhdone, exchange = Exchange { client_id: CryptoVec { p: 0x1ad06812960, size: 28, capacity: 32 }, server_id: CryptoVec { p: 0x1ad04a7b270, size: 37, capacity: 64 }, client_kex_init: CryptoVec { p: 0x1ad06816de0, size: 342, capacity: 512 }, server_kex_init: CryptoVec { p: 0x1ad04abc3b0, size: 94, capacity: 128 }, client_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 }, server_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 } }
[2023-05-08 11:43:49] debug [tunnels::connections::relay_tunnel_host] established host relay primary session
[2023-05-08 11:43:49] debug Connected to tunnel endpoint: TunnelRelayTunnelEndpoint { base: TunnelEndpoint { connection_mode: TunnelRelay, host_id: "96f3ba6b-5fa6-48fc-b273-5f003c347aa0", host_public_keys: [], port_uri_format: Some("https://dgm3ggl2-{port}.uks1.devtunnels.ms/"), tunnel_uri: Some("https://dgm3ggl2.uks1.devtunnels.ms/"), port_ssh_command_format: Some("ssh dgm3ggl2-{port}@ssh.uks1.devtunnels.ms"), tunnel_ssh_command: Some("ssh dgm3ggl2@ssh.uks1.devtunnels.ms"), ssh_gateway_public_key: None }, host_relay_uri: Some("wss://uks1-data.rel.tunnels.api.visualstudio.com/api/v1/Host/Connect/dgm3ggl2"), client_relay_uri: Some("wss://uks1-data.rel.tunnels.api.visualstudio.com/api/v1/Client/Connect/dgm3ggl2") }
[2023-05-08 11:43:49] debug Visual Studio Code Server is listening for incoming connections

Open this link in your browser https://insiders.vscode.dev/tunnel/surface-pc/C:/WINDOWS/system32

[2023-05-08 11:43:49] trace Found token in keyring
[2023-05-08 11:44:49] debug [tunnels::connections::ws] sent liveness ping
[2023-05-08 11:44:49] debug [tunnels::connections::ws] received liveness pong

@connor4312
Copy link
Member

The logic here is that I start the tunnel in verbose mode when in a service, so that if something goes wrong someone can retroactively grab logs from it (instead of having to uninstall the service, start it in verbose mode, and reproduce the problem.)

Most of the cryptic debug logs are from the SSH dependency. These were very useful when I was first reverse-engineering devtunnels but could be reduced, now, with the downside that if they are needed I would need to make a new build to get them.

Thoughts?

@aeschli
Copy link
Contributor Author

aeschli commented May 9, 2023

I would suggest something like:

Tunnel started as service. You can use `code-insiders tunnel service log` to monitor it, and `code-insiders tunnel service uninstall` to remove it.

That would mean the tunnel is started in a special way, e.g. by code-insiders tunnel service run

@connor4312
Copy link
Member

I think this actually duplicates #184058, which I fixed last week

@connor4312 connor4312 added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) remote-tunnel
Projects
None yet
Development

No branches or pull requests

4 participants