Skip to content

fix(ftp): name the server a connection fails to reach and log it quietly - #636

Merged
linroid merged 1 commit into
mainfrom
fix/ftp-unresolved-host
Oct 23, 2026
Merged

linroid merged 1 commit into
mainfrom
fix/ftp-unresolved-host

Conversation

@linroid

@linroid linroid commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Problem

An FTP link whose host doesn't resolve failed like this:

[ERROR] [FtpClient] Failed to connect to ftp.invalid:21: UnresolvedAddressException
[WARN] [Execution] Retry 1/3 ... Network: Network error occurred <- UnresolvedAddressException
... (the same pair for every attempt)
Download failed: Network: Network error occurred <- UnresolvedAddressException
  • UnresolvedAddressException has no message, so the reported failure never said which server it couldn't reach.
  • Every retried attempt also logged at ERROR, on top of the retry's own warning. AGENTS.md keeps error for fatal problems, and KtorHttpEngine logs the transport failures its callers retry at debug.

Fix

  • RealFtpClient.connect wraps a failure in an FtpConnectException cause ("Cannot connect to host:port"). This is how HTTP's FailedRequest names its request.
  • That line is now logged at debug.
Download failed: Network: Network error occurred <- FtpConnectException: Cannot connect to ftp.invalid:21 <- UnresolvedAddressException

Tests

RealFtpClientConnectTest:

  • A refused connection is logged once at debug, with nothing at warn or above, and its error names the server.
  • An unresolved .invalid host is named in the error.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T18:57:09.851512Z 8722483 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 23, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 2 201 files   2 229 suites   57m 42s ⏱️
15 388 tests 15 120 ✅ 268 💤 0 ❌
18 755 runs  18 487 ✅ 268 💤 0 ❌

Results for commit 1bfc6a2.

♻️ This comment has been updated with latest results.

An FTP link to a host that does not resolve failed with
"Network error occurred <- UnresolvedAddressException", naming no
host, and every retried attempt logged "[ERROR] [FtpClient] Failed to
connect" on top of the retry's own warning.

The control connection's failure now carries a cause naming where it
was going ("Cannot connect to ftp.invalid:21"), as HTTP's failures name
their request, and is logged at debug, as KtorHttpEngine logs transport
failures its callers retry and report.
@linroid
linroid force-pushed the fix/ftp-unresolved-host branch from 8722483 to 1bfc6a2 Compare October 23, 2026 19:40
@linroid
linroid merged commit 0784a36 into main Oct 23, 2026
14 checks passed
@linroid
linroid deleted the fix/ftp-unresolved-host branch October 23, 2026 20:17
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