Skip to content

fix(ssh): say when this computer can't download Node for a managed server, and where an offline copy goes - #30911

Merged
nwparker merged 2 commits into
mainfrom
nwparker/ssh-managed-forwarding-refused
Oct 20, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/ssh-managed-forwarding-refused

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​71 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​71
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32

ELI5

To start Orca's server on an SSH host, the Orca app on your computer downloads Node.js once and uploads it to the host. The host never downloads anything. When your computer couldn't reach nodejs.org, Orca showed only "Orca couldn't start its server on this host. Try connecting again." with the detail net::ERR_CONNECTION_REFUSED. That points at the host, and connecting again can't help. The detail now says what actually happened and how to get past it, including without internet access.

What Changed

Before: a user on an intranet saw the setup stop with the detail net::ERR_CONNECTION_REFUSED. They concluded the remote host needed internet access to "install Orca".

After: the detail reads:

This computer couldn't download Node from https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-x64.tar.gz (net::ERR_CONNECTION_REFUSED). Orca uploads Node to the host from this computer, so the host doesn't need internet access, but this computer must reach that address once. Check this computer's network connection or proxy and connect again, or download that file on another machine and copy it to <userData>/orcad-artifacts/node/archives/node-v24.21.0-linux-x64.tar.gz

Mechanism: materializeVerifiedRuntimeArchive (src/main/node-runtime/pinned-runtime-materializer.ts) is the one place that downloads the pinned Node archive for SSH, WSL and Windows-host deploys. It now wraps a network failure in that message and keeps the original as cause. Three kinds of error pass through unchanged:

  • a cancel, which keeps the caller's abort reason;
  • a ReleaseMismatchError (checksum, size or 404);
  • a local filesystem error that has an errno code.

The offline route already worked: the cache accepts any file at that path that matches the pinned SHA-256, with no download. The message just tells people about it.

Why

net::ERR_CONNECTION_REFUSED only comes from Electron's Chromium net.fetch. Checked live: Electron 43 net.fetch to a closed port rejects with exactly that string, while the ws client the desktop uses to reach orcad through the tunnel reports connect ECONNREFUSED 127.0.0.1:<port>. During managed-server setup, the only Chromium fetch is this Node archive download (orcad-remote-deploy.ts → installOrcadBundle → ensureRemoteOrcadNodeRuntime → archivePath()). Rejected alternatives:

  • Adding a new status reason for the headline: it changes the published status shape for a single failure.
  • A built-in mirror setting: it's a bigger product decision. The cache drop-in already gives an offline path with no new surface.

Linked Issue

User report from Slack/WeChat (no GitHub issue).

Visual Proof

N/A. The change is text-only, in the "Details" line under the SSH host. The new message is quoted above.

Testing

  • src/main/node-runtime/pinned-runtime-materializer-node.test.ts:

    • new: a refused download produces the actionable message with the URL, the raw cause and the drop-in path. This test fails on main with Received: "net::ERR_CONNECTION_REFUSED";
    • new: a copy placed at that path is used without fetching;
    • new: a local EEXIST stays raw.
  • Ran single-worker: src/main/node-runtime, src/main/wsl/wsl-pinned-runtime.test.ts, src/main/ai-vault/opencode-wsl-runtime-preparation.test.ts, src/main/managed-server/host-state, src/main/ssh/orcad-remote-deploy.test.ts and src/main/orcad all pass. The only failure is orcad-forked-child-paths.test.ts, the known macOS /private/var temp-dir issue, which this change doesn't touch.

  • Ran the static job steps locally: all pass except the VM rollback oracle, which can't resolve zod from its temp baseline on this machine (unrelated).

  • Verified live: Electron's net.fetch error string. Also confirmed the npmmirror.com copy of node-v24.21.0-linux-x64.tar.gz has the pinned SHA-256, so a mirror download works as a drop-in.

  • Verified only in CI (existing coverage): the debian10-no-egress cell in ssh-hostile-hosts shows a host with no internet activates orcad, and ssh-orcad-auto-convert.spec.ts covers a host with AllowTcpForwarding no using the stdio bridge.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Codex (gpt-6.1-sol, high): no findings. Independent Opus review: see comments.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: the host's behaviour is unchanged.
  • Cross-platform: the path comes from path.join.
  • Wire: there's no wire change, because detail is already free text.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f796a862-bca5-43fa-a3f1-443ba4e35f86
📥 Commits

Reviewing files that changed from the base of the PR and between 71ae282 and 768273b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

The materializer now classifies archive download failures. It preserves abort errors, release mismatches, and errors with a string code. It wraps other failures with the archive URL, original cause, and offline-cache guidance. Added tests cover retries and error details, reuse of a valid cached archive, and propagation of an EEXIST error.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 71ae2

Some download failures still omit the URL and offline-cache instructions. This is a bounded issue to fix or accept before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description covers the required change, rationale, testing, visual proof, review notes, and checklist. However, the Linked Issue section is incomplete because it provides only Slack/WeChat reports… Add a link to the GitHub issue addressed by this pull request. If no issue exists, create or identify the required issue before merging.
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the SSH error-message change and the offline Node archive path. It is specific and related to the primary change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the required change, rationale, testing, visual proof, review notes, and checklist. However, the Linked Issue section is incomplete because it provides only Slack/WeChat reports and no actual issue reference, despite the repository template requiring one.

Resolution

Add a link to the GitHub issue addressed by this pull request. If no issue exists, create or identify the required issue before merging.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be17c886-3410-40b8-aeba-ad64b244e628
📥 Commits

Reviewing files that changed from the base of the PR and between 0a3d203 and 71ae282.

📒 Files selected for processing: 2
  • src/main/node-runtime/pinned-runtime-materializer-node.test.ts
  • src/main/node-runtime/pinned-runtime-materializer.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Comment on lines +100 to +102
const localFailure = error instanceof Error && 'code' in error && typeof error.code === 'string'
if (signal?.aborted || error instanceof ReleaseMismatchError || localFailure) {
return error

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wrap coded network failures.

If fetcher rejects with an error whose code is ECONNREFUSED, this check returns the error unchanged. The user then gets neither the download URL nor the offline cache path. Distinguish known local filesystem errors from network errors instead of treating every string code as a local failure. The PR objective calls for wrapping network failures while preserving local filesystem errors.

@nwparker
nwparker merged commit f1135dd into main Oct 20, 2026
47 of 48 checks passed
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