{"record":{"id":"7eca679a0c842dff","repo":"Hmbown/CodeWhale","slug":"bundle-fetch-request-failed","errorCode":null,"errorMessage":"bundle fetch request failed","messagePattern":"bundle fetch request failed","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/config_bundles.rs","lineNumber":772,"sourceCode":"    let mut current_url = reqwest::Url::parse(url).map_err(|_| anyhow!(\"invalid bundle URL\"))?;\n    validate_bundle_url(&current_url)?;\n    let initial_scheme = current_url.scheme().to_string();\n\n    let client = codewhale_release::platform_blocking_http_client_builder()\n        .timeout(std::time::Duration::from_secs(FETCH_TIMEOUT_SECS))\n        // Redirect targets must pass the same scheme/host policy as the\n        // initial request, so redirects are followed explicitly below.\n        .redirect(reqwest::redirect::Policy::none())\n        .build()\n        .map_err(|_| anyhow!(\"building bundle fetch client failed\"))?;\n    let mut redirects = 0usize;\n    let response = loop {\n        let response = client\n            .get(current_url.clone())\n            .send()\n            // reqwest errors can include the full URL (including its query or\n            // userinfo), so keep transport failures deliberately URL-free.\n            .map_err(|_| anyhow!(\"bundle fetch request failed\"))?;\n\n        if !response.status().is_redirection() {\n            break response;\n        }\n        if redirects >= MAX_REDIRECTS {\n            bail!(\"bundle fetch exceeded the five-redirect limit\");\n        }\n        let location = response\n            .headers()\n            .get(reqwest::header::LOCATION)\n            .ok_or_else(|| anyhow!(\"bundle redirect is missing a valid Location header\"))?\n            .to_str()\n            .map_err(|_| anyhow!(\"bundle redirect is missing a valid Location header\"))?;\n        let next_url = current_url\n            .join(location)\n            .map_err(|_| anyhow!(\"bundle redirect Location is invalid\"))?;\n        validate_bundle_redirect(&initial_scheme, &next_url)?;\n        current_url = next_url;","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/config_bundles.rs#L754-L790","documentation":"fetch_bundle issues a GET to the bundle URL through reqwest and deliberately discards the underlying error, because reqwest transport error Display strings can embed the full URL including query strings or userinfo credentials. This message means the HTTP request itself failed at the transport layer (DNS, connect, TLS, timeout) before any response was received. The URL-free message is a security choice to avoid leaking secrets.","triggerScenarios":"client.get(url).send() returns Err — unreachable host, DNS failure, connection refused/reset, TLS handshake failure, or request timeout during bundle import over http(s).","commonSituations":"Importing a bundle from a typoed or down host, offline or air-gapped environments (tests explicitly cover no-network-access), firewall blocking the port, invalid or self-signed TLS certificates.","solutions":["Verify the bundle URL is correct and the server is reachable (curl the URL from the same machine).","Check network connectivity / DNS and proxy settings.","If TLS is the issue, ensure the server presents a certificate trusted by the system store.","Run the command with network access enabled; sandboxed/no-network environments always produce this error."],"exampleFix":"// before\nlet url = \"htp://wrong-scheme/bundle.toml\";\ncodewhale bundle import --url url\n// after\nlet url = \"https://reachable-host/bundle.toml\";\ncodewhale bundle import --url url","handlingStrategy":"retry","validationCode":"if let Ok(h) = reqwest::Client::new().get(bundle_url).send().await { println!(\"reachable: {}\", h.status()); }","typeGuard":null,"tryCatchPattern":"match fetch_bundle(url) { Err(e) if e.to_string().contains(\"bundle fetch request failed\") => { eprintln!(\"host unreachable; check URL/network\"); retry_with_backoff(3); } Ok(b) => apply(b), Err(e) => return Err(e), }","preventionTips":["Curl the bundle URL before scripting an import.","Ensure the environment has network access; no-network sandboxes always fail here.","Use https with a trusted certificate.","Prefer mirroring the bundle locally in CI."],"tags":["network","http","config-bundles"],"backgroundTag":"http-request-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T21:17:16.096Z"}