Skip to content

brev refresh writes <instance>-host with the instance IP but the gateway port (v0.6.337), so host SSH times out #531

Open

Description

@TaekyungHeo

Summary

Since v0.6.331+ (observed on v0.6.337), brev refresh writes the <instance>-host SSH alias with the instance's own public IP as Hostname but the gateway's port as Port. The pair is unreachable, so ssh <instance>-host (and brev exec --host) time out on a healthy VM-mode instance, while ssh <instance> reaches the same VM through the gateway.

Possibly the root cause of #436 ("reaches the published host SSH endpoint but times out").

Observed (v0.6.337, macOS, VM-mode instances)

Instance <instance> alias <instance>-host alias
AWS g4dn.xlarge global.prd.ga.run.brev.nvidia.com:23126 → reachable, lands on the VM (hostname brev-…, nvidia-smi, docker) <public IP>:23126 → connect timed out; <public IP>:22 also timed out
GCP n2d-standard-16 global.prd.ga.run.brev.nvidia.com:18041 → TCP accepted <public IP>:18041 → refused/timed out

Inside the AWS VM, sshd listens on 0.0.0.0:22 and checkip returns the same public IP, so the alias names the right host with the wrong port (the gateway's).

Cause

pkg/ssh/sshconfigurer.go makeSSHConfigEntryV2:

  • v0.6.324: the -host entry uses HostName: hostname (the workspace DNS, i.e. the gateway) with Port: workspace.GetHostSSHPort().
  • v0.6.337 (and main): it uses HostName: workspace.GetHostSSHHostname() (the instance IP) with the same GetHostSSHPort().

For these instances HostSSHPort == SSHPort is the gateway's port, so the new hostname and the old port no longer belong together.

Expected

<instance>-host reaches the host: either the gateway with HostSSHPort (as in v0.6.324), or the instance address with a port its security group opens.

Workaround

Use the <instance> alias for VM-mode instances.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions