Kuberwastaken/claurst · error

GitHub API returned for

Error message

GitHub API returned {} for {}

What it means

The GitHub Releases API request (GET /repos/Kuberwastaken/claurst/releases/latest) returned a non-success HTTP status — the formatted values are the status code and URL. Typical causes: API rate limiting (403/429 with no token), a network proxy, or GitHub being unreachable.

Solutions

  1. Retry after a minute — unauthenticated GitHub API requests are limited to 60/hour per IP
  2. Check network/proxy access to api.github.com
  3. If the repo moved or the release is missing, fetch the latest tag from the releases page manually
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-rust/crates/cli/src/upgrade.rs:190 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/31b0a2852b4d568e. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/cli/src/upgrade.rs:190

        (format!("{}-{}.zip", APP, target), true)
    } else {
        (format!("{}-{}.tar.gz", APP, target), false)
    }
}

// ---------------------------------------------------------------------------
// GitHub API: latest version
// ---------------------------------------------------------------------------

async fn fetch_latest_version() -> Result<String> {
    let url = format!("https://api.github.com/repos/{}/releases/latest", REPO);
    let client = reqwest::Client::builder()
        .timeout(Duration::from_secs(10))
        .user_agent(format!("claurst-upgrade/{}", env!("CARGO_PKG_VERSION")))
        .build()?;
    let resp = client.get(&url).send().await?;
    if !resp.status().is_success() {
        bail!("GitHub API returned {} for {}", resp.status(), url);
    }
    let json: serde_json::Value = resp.json().await?;
    let tag = json
        .get("tag_name")
        .and_then(|v| v.as_str())
        .ok_or_else(|| anyhow!("no tag_name in GitHub API response"))?;
    Ok(tag.trim_start_matches('v').to_string())
}

// ---------------------------------------------------------------------------
// Download
// ---------------------------------------------------------------------------

async fn download_to_file(url: &str, dest: &Path) -> Result<()> {
    let client = reqwest::Client::builder()
        .timeout(Duration::from_secs(120))
        .user_agent(format!("claurst-upgrade/{}", env!("CARGO_PKG_VERSION")))
        .build()?;

View on GitHub (pinned to b0637c97ec)