Repository navigation
cli 0.8.0: doctor, IPv4/IPv6 fallback, same-service entry switch - #32
Merged
Merged
Conversation
… same service - sourcegraph doctor: DNS, a connection to each IPv4/IPv6 address, HTTPS and the sign-in, with advice. - Turn on IPv4/IPv6 family fallback on Node 18 as Node 20+ does; NETWORK_ERROR lists the addresses tried. Node 18.18+. - A deployment whose site has a production entry (same service, another network path) uses that entry when the site cannot be reached at all and the request never left this machine. - Skill and README: troubleshooting for NETWORK_ERROR and MCP timeouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Background
A user's CLI timed out (
UND_ERR_CONNECT_TIMEOUT) on one entry of a service while another entry worked. The error carried only a code, with no hint of which addresses or address family failed. On Node 18 the CLI does not fall back between IPv4 and IPv6, so a network that reaches a site over only one family waits 10 s and fails. The skill had no troubleshooting guidance for this, including for MCP clients.Changes
CLI 0.8.0 (
cli/):sourcegraph doctor: checks DNS, a TCP connection to each IPv4/IPv6 address, HTTPS (/readyz) and the sign-in, then gives advice. Exit code 1 when the site cannot be reached or the sign-in failed;--jsonsupported.net.setDefaultAutoSelectFamily(true)at startup, so Node 18 behaves like Node 20+. The Node option--no-network-family-autoselectionturns it off.NETWORK_ERRORlists every address tried with its error and points tosourcegraph doctor.production_entry(the same service over another network path), and the site cannot be reached at all, the command uses that entry with the same token and prints a note. It switches only when the request never left the machine (name not resolved, connection refused/unreachable, connect timeout). The default profile has one site, so this is a no-op there.engines.nodeis now>=18.18, the first version with family fallback.Skill and README (generated from
scripts/deployment): troubleshooting forNETWORK_ERRORand MCP timeouts. Rundoctorfirst. MCP clients on Node 18 needNODE_OPTIONS=--network-family-autoselection. Don't edit the CLI launcher. Plugin version bumped to 0.8.0.Risks
Backward compatibility
doctorcommand, plus a note on stderr when the CLI switches entries.gh release create v0.8.0publishes@c4a/sourcegraph0.8.0.Testing
bun test: 16 pass. Newcli/src/network.test.tscovers:doctoragainst https://context4ai.org/sourcegraph from a machine without IPv6 reports the IPv6 address failing and IPv4 answering.tsc: no new errors.node scripts/sync-deployment.mjs --checkpasses.🤖 Generated with Claude Code