{"record":{"id":"ed419f624c27e3f6","repo":"tonhowtf/omniget","slug":"unreachable-connect-timed-out-after","errorCode":null,"errorMessage":"unreachable: connect timed out after {:?}","messagePattern":"unreachable: connect timed out after (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/http_fetcher.rs","lineNumber":684,"sourceCode":"    }\n    let head = match tokio::time::timeout(timeout, req.send()).await {\n        Ok(Ok(r)) if r.status().is_success() => Some(r),\n        Ok(Ok(r)) => {\n            tracing::debug!(\"[http_fetcher] HEAD returned HTTP {}\", r.status());\n            None\n        }\n        // Sem conexão não adianta tentar o GET de 1 byte: é o mesmo host.\n        // Falhar aqui poupa um segundo timeout inteiro por tentativa quando o\n        // servidor está fora (proof.ovh.net levou 495 s para desistir).\n        Ok(Err(e)) if e.is_connect() => {\n            return Err(anyhow!(\"unreachable: {}\", e));\n        }\n        Ok(Err(e)) => {\n            tracing::debug!(\"[http_fetcher] HEAD failed: {}\", e);\n            None\n        }\n        Err(_) => {\n            return Err(anyhow!(\n                \"unreachable: connect timed out after {:?}\",\n                timeout\n            ));\n        }\n    };\n\n    if let Some(resp) = head {\n        let h = resp.headers();\n        let content_length = header_content_length(h);\n        let accept_ranges = h\n            .get(reqwest::header::ACCEPT_RANGES)\n            .and_then(|v| v.to_str().ok())\n            .map(|v| v.contains(\"bytes\"))\n            .unwrap_or(false);\n        if content_length.is_some() {\n            return Ok(RemoteProbe {\n                content_length,\n                accept_ranges,","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/http_fetcher.rs#L666-L702","documentation":"The HEAD request in probe_remote is wrapped in tokio::time::timeout. When the future does not complete within the configured timeout duration, the match falls into the Err(_) arm and the library returns this error, naming the elapsed duration. It indicates the host did not even establish/answer within the connect window.","triggerScenarios":"Calling probe/probe_url against a host that accepts no response within `timeout` — e.g. a firewalled host that silently drops SYN packets, or an overloaded server — so tokio::time::timeout fires on req.send().","commonSituations":"proof.ovh.net-style hosts that hang instead of refusing (the code comment cites a 495 s hang), over-aggressive timeout values on slow links, or packets dropped by middleboxes causing black-hole connects.","solutions":["Increase the timeout passed to probe_remote if the host is known to be slow.","Confirm basic reachability with `curl -m <timeout> -I <url>` to reproduce outside the library.","Check for firewall rules silently dropping packets (drop vs reject produces timeouts instead of refusals).","Retry later — the target host may be temporarily overloaded or down."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match probe_remote(client, url, headers, timeout).await {\n    Err(e) if e.to_string().contains(\"connect timed out\") => {\n        // retry once with a larger timeout before giving up\n    }\n    other => { other?; }\n}","preventionTips":["Choose timeouts suited to the slowest expected link (mobile/satellite), not localhost latencies.","Distinguish drop-style firewalls (timeouts) from reject-style (refusals) when debugging.","Cache probe results briefly to avoid hammering a down host.","Alert on hosts that repeatedly hit connect timeouts."],"tags":["network","timeout","probe","connect"],"backgroundTag":"request-timeout","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}