Detect SSH auth failure on private-repo deploy and emit clear error#742
Merged
Conversation
When npm pack fails with git exit 128 due to SSH auth issues (missing key, publickey denied, host key unverified, or missing SSH uid), translate the raw npm/git stderr passthrough into a single actionable error message that tells the user to configure their SSH key. Original stderr is preserved via the error cause chain. Closes #185 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The prior message only mentioned SSH key configuration, which would mislead users hitting a host-key verification failure (the newly added Host key verification failed pattern). Broaden to also point at ssh/known_hosts so all four detected failure modes are covered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Reviewed; no blockers found. |
cb1kenobi
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes HarperFast/harper-pro#185
Summary
When
npm packfails with git exit 128 due to SSH auth issues, the raw npm/git stderr was passed through as-is — leaving users to dig through error noise to find the actual cause.This detects four SSH failure patterns in the subprocess stderr:
Could not read from remote repositoryPermission denied (publickey)No user exists for uid(SSH daemon not configured)Host key verification failed(host not in known_hosts)…and replaces the raw passthrough with a single actionable error:
Original stderr is preserved via the error
causechain for debugging.Notes
isSSHAuthFailureis exported for unit testing (6 cases, all passing).Cross-model review (Gemini) suggested: adding
Host key verification failedpattern (done),causechaining (done), and URL verification language in the message (done). statusCode on the thrown error was considered but skipped — the existing validation errors in this file don't use it, and the issue only requires a clear message in the API response.🤖 Generated by Claude Sonnet 4.6