Skip to content

SSH logs timeout for normal disconnection #16486

Open
@spikecurtis

Description

@spikecurtis

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Connecting from Windows to my Linux workspace with coder ssh, then disconnecting by typing exit at the terminal results in the Agent logging a normal session termination, followed by a timeout on the SSH connection. This is unhelpful because it makes it hard to determine when SSH connections are unintentionally getting disconnected.

Secondarily, in the log output, we don't log the remote address correctly.

Relevant Log Output

2025-02-07 04:33:31.630 [info]  ssh-server: normal ssh session exit  remote_addr=[fd7a:115c:a1e0:4077:b6f7:174c:2b34:45dd]:40984  local_addr=[fd7a:115c:a1e0:4450:9b88:8d20:91e0:e413]:1  id=4d7a5756-1dc1-4e4b-a50d-661a79e1e12f
2025-02-07 04:34:03.871 [info]  ssh-server: ssh connection complete  remote_addr=<nil>  local_addr=[fd7a:115c:a1e0:4450:9b88:8d20:91e0:e413]:1  error="read tcp [fd7a:115c:a1e0:4450:9b88:8d20:91e0:e413]:1: operation timed out"

Expected Behavior

If we aren't tearing down the connection gracefully, we should. If the connection is being torn down gracefully, and the logs are wrong, we need to fix them.

Steps to Reproduce

  1. coder ssh <workspace>
  2. at the prompt, exit
  3. look at the agent logs

Environment

  • Host OS:
  • Coder version: 2.19-dev on the server, on the client: Coder v2.18.4+6125358

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue that require triagenetworkingArea: networkings3Bugs that confuse, annoy, or are purely cosmetic

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions