fix(shell): clear message when SSHing to a node without access#418
Open
theFong wants to merge 1 commit into
Open
fix(shell): clear message when SSHing to a node without access#418theFong wants to merge 1 commit into
theFong wants to merge 1 commit into
Conversation
When an org member runs 'brev shell <node>' on a BYON node they can see in 'brev ls nodes' but have not been granted SSH access, they hit a confusing catch-all error: cannot resolve SSH for node "dgx-station" — no access, no port, or no hostname Replace it with classifyNodeSSHFailure, which mirrors ResolveNodeSSHEntry's resolution logic and surfaces the actual cause with a remedy: - no access grant (the common case): tell the user they lack access and show the 'brev grant-ssh' command an org admin can run, with their email prefilled - access granted but port not allocated / hostname not ready: explain the node may still be connecting and suggest 'brev refresh' This flows through shell, exec, copy, open, and port-forward via ResolveExternalNodeSSH. ResolveNodeSSHEntry (used by refresh for bulk config generation, where silent skipping is correct) is unchanged. Fixes BRE2-953
patelspratik
approved these changes
Jun 26, 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.
Problem
BRE2-953
When an org member runs
brev shell <node>(orbrev ssh <node>) on a BYON node they can see inbrev ls nodesbut have not been granted SSH access, they hit a confusing catch-all error:It's unclear why it fails when the node is right there in the list.
Fix
brev shell <node>resolves the node viaFindExternalNode→ListNodes(the same source asbrev ls nodes), then callsResolveExternalNodeSSH. That function returned one error for three unrelated causes. This PR replaces it withclassifyNodeSSHFailure, which mirrorsResolveNodeSSHEntry's resolution logic and surfaces the actual cause with a remedy:brev refresh."This flows through
shell,exec,copy,open, andport-forward, which all resolve viaResolveExternalNodeSSH.ResolveNodeSSHEntry(used byrefreshfor bulk SSH-config generation, where silently skipping inaccessible nodes is correct) is left unchanged.Tests
TestResolveExternalNodeSSH_NoAccessto assert the message mentions lacking access, suggestsbrev grant-ssh, and includes the user's email.TestResolveExternalNodeSSH_EmptyHostnameto assert the "granted but not ready" message.TestResolveExternalNodeSSH_NoPortAllocated.All affected packages build and pass:
util,shell,refresh,copy,open,portforward.