Skip to content

fix: refine errors for private maddr dial failures#98

Merged
2color merged 5 commits intomainfrom
fix-private-dials
Jul 30, 2025
Merged

fix: refine errors for private maddr dial failures#98
2color merged 5 commits intomainfrom
fix-private-dials

Conversation

@2color
Copy link
Copy Markdown
Member

@2color 2color commented Jul 16, 2025

When connection gater blocks private addresses, provide clearer error messages
instead of showing detailed "gater disallows connection to peer" errors.

  • Add formatConnectionError function to detect and summarize private address failures
  • Show "all X addresses are private/local" when only private addresses are found
  • Show "no good addresses (X private addresses filtered out)" when mixed
  • Preserve original error messages for other connection failures
  • Add tests for error formatting scenarios

Fixes #96

Related: ipshipyard/roadmaps#11

When connection gater blocks private addresses, provide clearer error messages
instead of showing detailed "gater disallows connection to peer" errors.

- Add formatConnectionError function to detect and summarize private address failures
- Show "all X addresses are private/local" when only private addresses are found
- Show "no good addresses (X private addresses filtered out)" when mixed
- Preserve original error messages for other connection failures
- Add tests for error formatting scenarios

Fixes #96
@2color 2color requested review from aschmahmann and lidel July 16, 2025 20:27
Copy link
Copy Markdown
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

pretty straightforward change, lgtm.. a few comments

2color and others added 2 commits July 25, 2025 14:27
Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
Copy link
Copy Markdown
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Fixed tests, lgtm.

daemon.go Outdated
if privateCount > 0 {
if publicCount == 0 {
return fmt.Sprintf("failed to dial: all %d addresses are private/local and cannot be reached from the public internet", privateCount)
} else {
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.

nit: else not needed

@lidel
Copy link
Copy Markdown
Member

lidel commented Jul 29, 2025

@2color mind merging & releasing & deploying to prod? 🙏

@2color 2color merged commit a3131ac into main Jul 30, 2025
10 checks passed
@2color 2color deleted the fix-private-dials branch July 30, 2025 19:46
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.

Better descriptions for dials that failed due to being for private addresses

4 participants