zed-industries/zed · error
GitHub returned an unexpected redirect ({}) for the authenti
Error message
GitHub returned an unexpected redirect ({}) for the authenticated request to {raw_url} What it means
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.
Source
Thrown at crates/settings_ui/src/pages/skill_creator.rs:1029
http_client::RedirectPolicy::NoFollow
} else {
http_client::RedirectPolicy::FollowAll
};
let request = Request::get(raw_url)
.follow_redirects(redirect_policy)
.when_some(github_token, |builder, token| {
builder.header("Authorization", format!("Bearer {token}"))
})
.body(AsyncBody::default())?;
let mut response = http_client
.send(request)
.await
.with_context(|| format!("failed to fetch {raw_url}"))?;
let status = response.status();
if github_token.is_some() && status.is_redirection() {
anyhow::bail!(
"GitHub returned an unexpected redirect ({}) for the authenticated request to {raw_url}",
status.as_u16()
);
}
let mut body = Vec::new();
response
.body_mut()
.take(MAX_SKILL_FILE_SIZE as u64 + 1)
.read_to_end(&mut body)
.await
.context("failed to read response body")?;
Ok((status, body))
}
fn github_fetch_error(status: StatusCode, body: &[u8]) -> anyhow::Error {
let mut message = if status == StatusCode::NOT_FOUND {
"GitHub returned 404 while fetching the skill; no repository exists at this URL, or it is private"View on GitHub (pinned to 9d272b0363)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/settings_ui/src/pages/skill_creator.rs:1029 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/75b8dd5ebc48d8e8.
Report an issue: GitHub.