Skip to content

fix(deploy-agent): show ssh's own error when the target cannot be reached - #241

Merged
Gerrrt merged 2 commits into
mainfrom
gerrrt/deploy-alloy-saruman-oracle-528dc8-jkznmz
Sep 2, 2026
Merged

fix(deploy-agent): show ssh's own error when the target cannot be reached#241
Gerrrt merged 2 commits into
mainfrom
gerrrt/deploy-alloy-saruman-oracle-528dc8-jkznmz

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What changed

scripts/deploy-agent.sh's preflight printed a guessed cause ("the key must already be authorised") over a discarded stderr. It now prints ssh's own message and a one-line map from the three BatchMode failures — unknown host key, permission denied, timeout — to their fixes.

Why

Follow-up to #88 / #240. The first run against Saruman from the Mac hit exactly this and the message was not enough to act on.

Blast radius

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

One script, local half only; nothing on any host changes.

Verification

  • shellcheck clean, bash -n clean
  • Exercised against nobody@10.0.99.30: prints ssh: nobody@10.0.99.30: Permission denied (publickey,password). followed by the mapped hint
  • make validate — lint and pins only affect this file; CI runs the full set

🤖 Generated with Claude Code

…ched

The preflight discarded ssh's stderr and then asserted the cause was an
unauthorised key. The first run against Saruman got exactly that message,
when BatchMode had a more specific one to offer — unknown host key,
password-only root, or no route — each of which is fixed differently.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 04:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new preflight writes SSH stderr to a predictable temp filename (symlink/clobber risk) and prefixes ssh: onto output that already typically includes ssh:, reducing safety and clarity.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves scripts/deploy-agent.sh’s SSH preflight by preserving and displaying SSH’s actual stderr (instead of a guessed failure cause), and adds a single-line hint mapping common BatchMode failures to likely fixes.

Changes:

  • Capture and print ssh stderr during the “hostname” preflight when the connection fails.
  • Replace the previous generic “key must already be authorised” message with SSH’s own error plus a brief hint mapping.
File summaries
File Description
scripts/deploy-agent.sh Improves preflight failure diagnostics by surfacing SSH stderr and providing actionable hints for common non-interactive SSH failures.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/deploy-agent.sh Outdated
A $$-named file in a shared temp directory can be pre-created or symlinked
by another user; mktemp cannot. And OpenSSH already prefixes its lines, so
the script's own "ssh:" doubled it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit b4056a0 into main Sep 2, 2026
3 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/deploy-alloy-saruman-oracle-528dc8-jkznmz branch September 2, 2026 04:43
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.

2 participants