lapce/lapce · error

get release info failed {}

Error message

get release info failed {}

What it means

Raised by get_latest_release() in lapce-app/src/update.rs when the GitHub Releases API request completes at the transport level but returns a non-success HTTP status. The response body is interpolated into the message, so the real cause (rate limit, missing release, proxy error page) is visible in the '{}'. This is Lapce's own updater talking to api.github.com, not a third-party library error.

Source

Thrown at lapce-app/src/update.rs:35

pub struct ReleaseAsset {
    pub name: String,
    pub browser_download_url: String,
}

pub fn get_latest_release() -> Result<ReleaseInfo> {
    let url = match meta::RELEASE {
        meta::ReleaseType::Debug => {
            return Err(anyhow!("no release for debug"));
        }
        meta::ReleaseType::Nightly => {
            "https://api.github.com/repos/lapce/lapce/releases/tags/nightly"
        }
        _ => "https://api.github.com/repos/lapce/lapce/releases/latest",
    };

    let resp = lapce_proxy::get_url(url, Some("Lapce"))?;
    if !resp.status().is_success() {
        return Err(anyhow!("get release info failed {}", resp.text()?));
    }
    let mut release: ReleaseInfo = serde_json::from_str(&resp.text()?)?;

    release.version = match release.tag_name.as_str() {
        "nightly" => format!(
            "{}+Nightly.{}",
            env!("CARGO_PKG_VERSION"),
            &release.target_commitish[..7]
        ),
        _ => release
            .tag_name
            .strip_prefix('v')
            .unwrap_or(&release.tag_name)
            .to_owned(),
    };

    Ok(release)
}

View on GitHub (pinned to c9e4c33948)

Solutions

  1. Read the '{}' body: 'API rate limit exceeded' means waiting until X-RateLimit-Reset (up to 1h for anonymous clients)
  2. Verify the endpoint manually: curl -i https://api.github.com/repos/lapce/lapce/releases/latest
  3. Retry with exponential backoff (30s, 2m) for transient 5xx/proxy failures
  4. Route Lapce through a proxy that caches or authenticates GitHub API calls (lapce_proxy::get_url honors standard proxy env vars)
  5. If the nightly tag is genuinely absent, wait for release CI to republish it

Example fix

// before
let resp = lapce_proxy::get_url(url, Some("Lapce"))?;
if !resp.status().is_success() {
    return Err(anyhow!("get release info failed {}", resp.text()?));
}

// after: keep the status code so callers can react to rate limits
let resp = lapce_proxy::get_url(url, Some("Lapce"))?;
let status = resp.status();
if !status.is_success() {
    let body = resp.text().unwrap_or_default();
    return Err(anyhow!(
        "get release info failed: HTTP {} — {}",
        status.as_u16(),
        body
    ));
}
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight: confirm the endpoint is reachable and not rate-limited before the real call
let resp = lapce_proxy::get_url("https://api.github.com/rate_limit", Some("Lapce"))?;
if resp.status().as_u16() == 403 {
    return Err(anyhow!("skip update check: GitHub API rate-limited"));
}

Try / catch

let release = match get_latest_release() {
    Ok(r) => r,
    Err(e) if e.to_string().contains("get release info failed") => {
        // 403 rate-limit / 5xx are transient: back off and retry once or twice
        std::thread::sleep(Duration::from_secs(30));
        get_latest_release()?
    }
    Err(e) => return Err(e),
};

Prevention

When it happens

Trigger: Calling get_latest_release() with meta::RELEASE set to Nightly or a stable release, and the GET to https://api.github.com/repos/lapce/lapce/releases/{tags/nightly|latest} answering 403 (unauthenticated rate limit, 60 req/hr), 404 (tag or repo missing), 401, or 5xx. lapce_proxy::get_url itself succeeded (no '?' error), only resp.status().is_success() is false.

Common situations: Frequent update checks or CI environments exhausting the anonymous GitHub API rate limit; nightly tag temporarily unpublished during release automation; corporate proxies / SSL inspection returning HTML error pages with a 4xx/5xx status; GitHub outage.

Related errors


AI-assisted analysis of lapce/lapce@c9e4c33948 (2026-08-16). Data as JSON: /api/errors/647a4cf20d91461e. Report an issue: GitHub.