{"record":{"id":"c79335bda28c9a64","repo":"spacedriveapp/spacedrive","slug":"failed-to-fetch-releases-http","errorCode":null,"errorMessage":"Failed to fetch releases: HTTP {}","messagePattern":"Failed to fetch releases: HTTP (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/cli/src/domains/update/mod.rs","lineNumber":133,"sourceCode":"\t}\n\n\tprintln!();\n\tprintln!(\"Successfully updated to version {}\", latest_version);\n\n\tOk(())\n}\n\nasync fn fetch_latest_release(repo: &str) -> Result<GitHubRelease> {\n\tlet url = format!(\"https://api.github.com/repos/{}/releases/latest\", repo);\n\n\tlet client = reqwest::Client::builder()\n\t\t.user_agent(\"spacedrive-cli\")\n\t\t.build()?;\n\n\tlet response = client.get(&url).send().await?;\n\n\tif !response.status().is_success() {\n\t\treturn Err(anyhow::anyhow!(\n\t\t\t\"Failed to fetch releases: HTTP {}\",\n\t\t\tresponse.status()\n\t\t));\n\t}\n\n\tlet release: GitHubRelease = response.json().await?;\n\tOk(release)\n}\n\nasync fn download_file(url: &str, expected_size: u64) -> Result<Vec<u8>> {\n\tlet client = reqwest::Client::builder()\n\t\t.user_agent(\"spacedrive-cli\")\n\t\t.build()?;\n\n\tlet response = client.get(url).send().await?;\n\n\tif !response.status().is_success() {\n\t\treturn Err(anyhow::anyhow!(","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/cli/src/domains/update/mod.rs#L115-L151","documentation":"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.","triggerScenarios":"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.","commonSituations":"CI jobs or cron schedules that call 'sd update' frequently; corporate proxies rewriting api.github.com; GitHub outage windows.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"#!/usr/bin/env bash\nstatus=$(curl -s -o /dev/null -w '%{http_code}' https://api.github.com/repos/spacedrive/spacedrive/releases/latest)\nif [ \"$status\" != 200 ]; then\n  echo \"GitHub API returned $status; not running sd update now\" >&2\n  exit 2\nfi\nsd update","typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    attempt += 1;\n    match fetch_latest_release(repo).await {\n        Ok(release) => break release,\n        Err(e) if attempt < 3 && e.to_string().contains(\"HTTP 403\") => {\n            tokio::time::sleep(std::time::Duration::from_secs(60 * attempt)).await; // rate limit backoff\n        }\n        Err(e) => return Err(e),\n    }\n};","preventionTips":["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"],"tags":["network","http","update","rate-limit"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}