{"record":{"id":"5e3cdb815bb3ca33","repo":"Hmbown/CodeWhale","slug":"failed-to-fetch-release-redirect-from-url-http","errorCode":null,"errorMessage":"failed to fetch release redirect from {url}: HTTP {status}\n{body}","messagePattern":"failed to fetch release redirect from (.+?): HTTP (.+?)\n(.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":1514,"sourceCode":"    let status = response.status();\n    let final_url = response.url().clone();\n    if status.is_success() {\n        if let Some(tag_name) = release_tag_from_github_release_url(&final_url) {\n            return Ok(tag_name);\n        }\n        let body = response\n            .text()\n            .with_context(|| format!(\"failed to read release redirect response from {url}\"))?;\n        if let Some(tag_name) = release_tag_from_github_release_html(&body) {\n            return Ok(tag_name);\n        }\n        bail!(\"release redirect did not resolve to a tag URL: {final_url}\");\n    }\n\n    let body = response\n        .text()\n        .with_context(|| format!(\"failed to read release redirect response from {url}\"))?;\n    bail!(\"failed to fetch release redirect from {url}: HTTP {status}\\n{body}\");\n}\n\nfn release_tag_from_github_release_url(url: &reqwest::Url) -> Option<String> {\n    let segments = url.path_segments()?.collect::<Vec<_>>();\n    segments\n        .windows(3)\n        .find(|window| window[0] == \"releases\" && window[1] == \"tag\")\n        .map(|window| window[2].to_string())\n        .filter(|tag| !tag.is_empty())\n}\n\nfn release_tag_from_github_release_html(body: &str) -> Option<String> {\n    const MARKERS: &[&str] = &[\n        \"/Hmbown/CodeWhale/releases/tag/\",\n        \"/hmbown/CodeWhale/releases/tag/\",\n        \"/releases/tag/\",\n    ];\n    for marker in MARKERS {","sourceCodeStart":1496,"sourceCodeEnd":1532,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/update.rs#L1496-L1532","documentation":"Thrown when the HTTP request for the GitHub release-redirect page returns a non-success status. The updater includes the status code and response body so the developer can see exactly what the server (or an intermediary) returned instead of the release page.","triggerScenarios":"Self-update issues the release-redirect request and receives HTTP 403/404/5xx or similar; the error message carries the status and body text.","commonSituations":"Rate limiting by GitHub (403 with rate-limit JSON), release URL changed or removed (404), corporate proxy blocking GitHub, transient GitHub 5xx outage.","solutions":["Read the HTTP status and body in the message: 403/429 means rate limited — wait or authenticate GH_TOKEN; 404 means the release URL is wrong.","Check GitHub status / retry after a short delay for transient 5xx.","Bypass proxies or allowlist github.com in the firewall.","Update manually by downloading the release artifact."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match updater::resolve_latest_tag() {\n    Err(e) if e.to_string().contains(\"HTTP 403\") || e.to_string().contains(\"HTTP 429\") => {\n        tokio::time::sleep(Duration::from_secs(60)).await; // rate limit: back off and retry\n        updater::resolve_latest_tag()\n    }\n    Err(e) if e.to_string().contains(\"HTTP 5\") => {\n        // transient server error: exponential backoff retry\n        retry_with_backoff(3, updater::resolve_latest_tag).await\n    }\n    other => other,\n}","preventionTips":["Set GH_TOKEN to raise GitHub API/redirect rate limits in CI.","Inspect the embedded status+body before retrying — only retry transient statuses.","Check githubstatus.com when seeing 5xx during update.","Have a manual download path ready for restricted networks."],"tags":["update","github","http","network"],"backgroundTag":"http-error-response","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}