Skip to content

FR-7571: name the missing setup step in SSH and sign-in errors - #42

Merged
frank-laemmer merged 1 commit into
mainfrom
fr-7571-name-the-missing-setup-step-in-frbit-cli-errors
Nov 26, 2026
Merged

frank-laemmer merged 1 commit into
mainfrom
fr-7571-name-the-missing-setup-step-in-frbit-cli-errors

Conversation

@frank-laemmer

Copy link
Copy Markdown
Member

🤖

Fixes FR-7571.

SSH (exit 255)

  • Split by ssh's stderr: rejected key, too many keys, failed connection, host key; the catch-all stays for the rest. Only on ssh's own exit 255, so remote output can't trigger it.
  • Rejected key: reads the ssh_key step from /v1/you and asks ssh -G / ssh-add -L which keys ssh can offer. Names: no key on the account, none here (ssh-keygen -t ed25519), key not on the account or needs ssh-add. Unknown → neutral message.
  • Applies to ssh, db pull/push, files, doctor.

Sign-in

  • API 401 and a refused refresh (invalid_grant, token endpoint 401) → api.SignInError: "the sign-in expired or was revoked; run frbit auth login [--profile] [--host]", or names FRBIT_TOKEN. Cause kept in brackets; errors.As(*api.HTTPError) still works.
  • A refresh that fails on the network no longer says to sign in again.

Setup step

  • auth login prints the open "Add an SSH key" step; doctor uses it as the SSH fix.

Review

  • Three review passes (correctness, adversarial security/cross-platform); all findings fixed except Windows cmd.exe quoting of the login hint.

Test

  • go test -race ./..., go vet, gofmt green.

🤖 Generated with Claude Code

🤖

- ssh exit 255: split a rejected key, too many keys, a failed connection
  and the host key; explain a rejected key from the account's ssh_key
  step and the keys ssh can offer here (ssh -G, ssh-add -L)
- API 401 and a refused refresh: one SignInError with the login command
  for the profile and host, naming FRBIT_TOKEN when it is the source
- auth login and doctor show the open "Add an SSH key" step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frank-laemmer
frank-laemmer force-pushed the fr-7571-name-the-missing-setup-step-in-frbit-cli-errors branch from e133bf0 to bcc4386 Compare November 26, 2026 10:01
@frank-laemmer
frank-laemmer merged commit 2222efe into main Nov 26, 2026
2 checks passed
@frank-laemmer
frank-laemmer deleted the fr-7571-name-the-missing-setup-step-in-frbit-cli-errors branch November 26, 2026 10:21
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.

1 participant