{"record":{"id":"294c799d68e562d4","repo":"astrid-runtime/astrid","slug":"github-api-returned-for-org-repo-latest-rel","errorCode":null,"errorMessage":"GitHub API returned {} for {org}/{repo} latest release","messagePattern":"GitHub API returned (.+?) for (.+?)/(.+?) latest release","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_github.rs","lineNumber":94,"sourceCode":"                .with_context(|| format!(\"invalid GitHub API response for tag {candidate}\"))?;\n            return Ok(json\n                .get(\"tag_name\")\n                .and_then(serde_json::Value::as_str)\n                .unwrap_or(&candidate)\n                .to_string());\n        }\n        bail!(\"no GitHub release found for version {version} in {org}/{repo}\");\n    }\n\n    tracing::debug!(%org, %repo, \"no version/tag pin — resolving latest release\");\n    let api_url = format!(\"https://api.github.com/repos/{org}/{repo}/releases/latest\");\n    let response = client\n        .get(&api_url)\n        .send()\n        .await\n        .context(\"failed to reach GitHub API for latest release\")?;\n    if !response.status().is_success() {\n        bail!(\n            \"GitHub API returned {} for {org}/{repo} latest release\",\n            response.status()\n        );\n    }\n    let json: serde_json::Value = response\n        .json()\n        .await\n        .context(\"invalid GitHub API response\")?;\n    Ok(json\n        .get(\"tag_name\")\n        .and_then(serde_json::Value::as_str)\n        .unwrap_or(\"latest\")\n        .to_string())\n}\n","sourceCodeStart":76,"sourceCodeEnd":109,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_github.rs#L76-L109","documentation":"When no version pin is given, resolve_github_ref fetches the repo's latest release from the GitHub API. A non-success HTTP status on that call aborts with this error, including the returned status code.","triggerScenarios":"install_from_github or resolve_capsule_to_file resolves an unpinned capsule; the GET to api.github.com/repos/{org}/{repo}/releases/latest returns a non-2xx status.","commonSituations":"Unauthenticated rate limiting (403 with rate-limit headers); the repo publishes releases but none are marked 'latest' (404); private repo without credentials (403); GitHub 5xx incidents; network middleboxes returning error pages.","solutions":["Set GITHUB_TOKEN and retry if you see 403/429 (rate limit).","Pin an explicit version/tag to skip the /releases/latest lookup entirely.","Confirm the repo exists and is public, or supply credentials for a private repo.","Check GitHub status / your network if the status is 5xx."],"exampleFix":"// before\nastrid capsule install github:org/repo   # rate-limited 403 on latest-release lookup\n// after\nexport GITHUB_TOKEN=ghp_...\nastrid capsule install github:org/repo@1.4.0   # or keep unpinned with auth","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match install_result {\n    Err(e) if e.to_string().contains(\"GitHub API returned\") && e.to_string().contains(\"429\") => {\n        tokio::time::sleep(Duration::from_secs(60)).await; // rate-limit window\n        retry_install().await\n    }\n    other => other,\n}","preventionTips":["Authenticate with GITHUB_TOKEN when resolving unpinned (latest) versions.","Prefer pinning an explicit version to skip the /releases/latest call.","Monitor GitHub API rate-limit headers in CI pipelines."],"tags":["github","http","api","latest-release"],"backgroundTag":"http-error-response","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}