torrust-tracker icon indicating copy to clipboard operation
torrust-tracker copied to clipboard

Tracker Checker: handle HTTP Tracker error `ConnectionRefused`

Open josecelano opened this issue 1 year ago • 0 comments

Parent issue: https://github.com/torrust/torrust-tracker/issues/669 Depends on: https://github.com/torrust/torrust-tracker/issues/680

When you run the Tracker Checker with a HTTP Tracker service not running you get this error:

TORRUST_CHECKER_CONFIG='{
    "udp_trackers": [],
    "http_trackers": ["http://127.0.0.1:7070"],
    "health_checks": []
}' cargo run --bin tracker_checker
Running checks for trackers ...
UDP trackers ...
HTTP trackers ...
thread 'main' panicked at /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/src/shared/bit_torrent/tracker/http/client/mod.rs:87:61:
called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(7070), path: "/announce", query: Some("info_hash=%9C8B%22%13%E3%0B%FF%21%2B0%C3%60%D2o%9A%02%13d%22&peer_addr=192.168.1.88&downloaded=0&uploaded=0&peer_id=%2DqB00000000000000001&port=17548&left=0&event=completed&compact=0"), fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After implementing the issue https://github.com/torrust/torrust-tracker/issues/680 we could catch the error and continue with the execution of the Tracker Checker, checking other services. CUrrently, the checker is halted without finishing.

josecelano avatar Feb 02 '24 16:02 josecelano