{"record":{"id":"75b8dd5ebc48d8e8","repo":"zed-industries/zed","slug":"github-returned-an-unexpected-redirect-for-th","errorCode":null,"errorMessage":"GitHub returned an unexpected redirect ({}) for the authenticated request to {raw_url}","messagePattern":"GitHub returned an unexpected redirect \\((.+?)\\) for the authenticated request to (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/settings_ui/src/pages/skill_creator.rs","lineNumber":1029,"sourceCode":"        http_client::RedirectPolicy::NoFollow\n    } else {\n        http_client::RedirectPolicy::FollowAll\n    };\n    let request = Request::get(raw_url)\n        .follow_redirects(redirect_policy)\n        .when_some(github_token, |builder, token| {\n            builder.header(\"Authorization\", format!(\"Bearer {token}\"))\n        })\n        .body(AsyncBody::default())?;\n\n    let mut response = http_client\n        .send(request)\n        .await\n        .with_context(|| format!(\"failed to fetch {raw_url}\"))?;\n\n    let status = response.status();\n    if github_token.is_some() && status.is_redirection() {\n        anyhow::bail!(\n            \"GitHub returned an unexpected redirect ({}) for the authenticated request to {raw_url}\",\n            status.as_u16()\n        );\n    }\n    let mut body = Vec::new();\n    response\n        .body_mut()\n        .take(MAX_SKILL_FILE_SIZE as u64 + 1)\n        .read_to_end(&mut body)\n        .await\n        .context(\"failed to read response body\")?;\n\n    Ok((status, body))\n}\n\nfn github_fetch_error(status: StatusCode, body: &[u8]) -> anyhow::Error {\n    let mut message = if status == StatusCode::NOT_FOUND {\n        \"GitHub returned 404 while fetching the skill; no repository exists at this URL, or it is private\"","sourceCodeStart":1011,"sourceCodeEnd":1047,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/settings_ui/src/pages/skill_creator.rs#L1011-L1047","documentation":"With a GitHub token attached, the fetch of the raw skill URL returned an HTTP redirect; because redirects on authenticated requests are not followed (NoFollow policy), this is treated as suspicious/misconfigured and reported with the redirect target.","triggerScenarios":"Thrown at crates/settings_ui/src/pages/skill_creator.rs:1029 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the import; GitHub sometimes issues redirects transiently","Verify the raw URL is correct and points at raw.githubusercontent.com content","Ensure the repository/file is accessible with the provided token"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}