Skip to content

fix: Add a slightly better error message for dropped SSH connection - #3131

Merged
dwahler merged 2 commits into
mainfrom
dwahler/1369-ssh-drop-error
Jul 25, 2022
Merged

dwahler merged 2 commits into
mainfrom
dwahler/1369-ssh-drop-error

Conversation

@dwahler

@dwahler dwahler commented Jul 22, 2022

Copy link
Copy Markdown
Contributor

If an SSH connection drops, we typically get an ssh.ExitMissingError from the client, which doesn't have a very user-friendly error message:

wait: remote command exited without exit status or exit signal

This PR looks for that error type and replaces it with message that, while not necessarily more helpful, at least doesn't incorrectly state the problem is on the remote side:

SSH connection ended unexpectedly

Partial fix for #1369

@kylecarbs kylecarbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

nit: typically we conform to fix: or feat: prefixes, but we should enforce this with a CI check so none slip

Comment thread cli/ssh.go Outdated
var workspacePollInterval = time.Minute
var autostopNotifyCountdown = []time.Duration{30 * time.Minute}

var errConnectionDropped = xerrors.New("SSH connection ended unexpectedly")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could inline this for now until it needs to be used elsewhere!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another point for inlining: it produces a stacktrace, otherwise we have to wrap the error to get a stack trace.

@dwahler dwahler changed the title Add a slightly better error message for dropped SSH connection fix: Add a slightly better error message for dropped SSH connection Jul 22, 2022

@BrunoQuaresma BrunoQuaresma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dwahler
dwahler merged commit 5312296 into main Jul 25, 2022
@dwahler
dwahler deleted the dwahler/1369-ssh-drop-error branch July 25, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants