spacedriveapp/spacedrive · error · anyhow::Error
Failed to fetch releases: HTTP {}
Error message
Failed to fetch releases: HTTP {} What it means
fetch_latest_release() does GET https://api.github.com/repos/{repo}/releases/latest with user-agent spacedrive-cli and bails on any non-2xx status. Common codes: 403 unauthenticated rate limit (60 requests/hour per IP), 404 wrong/renamed repo slug, 5xx GitHub incidents, or proxy interference.
Source
Thrown at apps/cli/src/domains/update/mod.rs:133
}
println!();
println!("Successfully updated to version {}", latest_version);
Ok(())
}
async fn fetch_latest_release(repo: &str) -> Result<GitHubRelease> {
let url = format!("https://api.github.com/repos/{}/releases/latest", repo);
let client = reqwest::Client::builder()
.user_agent("spacedrive-cli")
.build()?;
let response = client.get(&url).send().await?;
if !response.status().is_success() {
return Err(anyhow::anyhow!(
"Failed to fetch releases: HTTP {}",
response.status()
));
}
let release: GitHubRelease = response.json().await?;
Ok(release)
}
async fn download_file(url: &str, expected_size: u64) -> Result<Vec<u8>> {
let client = reqwest::Client::builder()
.user_agent("spacedrive-cli")
.build()?;
let response = client.get(url).send().await?;
if !response.status().is_success() {
return Err(anyhow::anyhow!(View on GitHub (pinned to 6dfeccf211)
Solutions
- Wait for the rate-limit window to reset (or query through a different network) and retry
- Verify connectivity: curl -I https://api.github.com/repos/<repo>/releases/latest
- Update manually from the releases page if the API is blocked
Defensive patterns
Strategy: retry
Validate before calling
#!/usr/bin/env bash
status=$(curl -s -o /dev/null -w '%{http_code}' https://api.github.com/repos/spacedrive/spacedrive/releases/latest)
if [ "$status" != 200 ]; then
echo "GitHub API returned $status; not running sd update now" >&2
exit 2
fi
sd update Try / catch
let mut attempt = 0;
loop {
attempt += 1;
match fetch_latest_release(repo).await {
Ok(release) => break release,
Err(e) if attempt < 3 && e.to_string().contains("HTTP 403") => {
tokio::time::sleep(std::time::Duration::from_secs(60 * attempt)).await; // rate limit backoff
}
Err(e) => return Err(e),
}
}; Prevention
- Cache the latest-release response so repeated 'sd update' calls stay under the 60 req/hr unauthenticated limit
- Authenticate API calls with a token in CI where the limit is shared
- Check GitHub's rate-limit headers (X-RateLimit-Remaining) before retrying
When it happens
Trigger: Running 'sd update' repeatedly from one IP until the rate limit trips; offline or TLS-intercepting networks; the repo constant pointing at a renamed repository.
Common situations: CI jobs or cron schedules that call 'sd update' frequently; corporate proxies rewriting api.github.com; GitHub outage windows.
Related errors
- Failed to download: HTTP {}
- Downloaded file size mismatch: expected {}, got {}
- No paired devices found. Pair a device first with: sd networ
- Remote device {} is not online
- Could not find sd binary for platform: {}
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/c79335bda28c9a64.
Report an issue: GitHub.