Skip to content

tracker_client check panics on a UDP tracker URL without a usable address #2984

Done

Description

@josecelano-bot

Goal

tracker_client check rejects a UDP tracker URL that has no host or no port as a usage/configuration error (exit 2, one JSON error record), and never panics on a UDP tracker address it cannot resolve.

Problem

Configuration validation only checks that each udp_trackers entry parses as a URL. The UDP check then calls url.socket_addrs(|| None).unwrap() in console/tracker-client/src/console/clients/checker/checks/udp.rs (resolve_socket_addr), which fails for a URL without a port, so the program panics. Reproduce on current develop (stdout must be a pipe):

TORRUST_CHECKER_CONFIG='{"udp_trackers":["udp://127.0.0.1"],"http_trackers":[],"health_checks":[]}' cargo run -p torrust-tracker-client --bin tracker_client -- check | cat

Result: one JSON panic record, then a runtime_failure record on stderr, exit 1, empty stdout. The same panic happens for udp:/// (no host), http://127.0.0.1 and ftp://127.0.0.1:6969 (a udp:// prefix is added in front, so there is no port), and udp://nonexistent.invalid:6969 (DNS failure). URLs that fail to parse already give exit 2 with an invalid_configuration record.

Proposed fix

  • Reject a udp_trackers entry with no host, no port or a non-udp scheme during configuration validation (exit 2, invalid_configuration).
  • Make resolve_socket_addr fallible, so an unresolvable host becomes a failed check for that tracker instead of a panic.
  • Regression unit tests at the configuration seam and a like-for-like recheck of the reproduction.

Not part of EPIC #2758; found while fixing #2768 (PR #2956). The specification and the reproduction evidence follow in a spec-only PR.

Activity

  1. added 15 commits that reference this issue on Nov 21, 2026
  2. 30 remaining items

  3. added 9 commits that reference this issue on Nov 23, 2026
  4. added 2 commits that reference this issue on Nov 24, 2026
  5. added a commit that references this issue on Nov 24, 2026
  6. added 2 commits that reference this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions