jdx/mise · error

fetching current index for {url} failed: {}

Error message

fetching current index for {url} failed: {}

What it means

Thrown by existing_index_entries when GET of the current tag's index (used before update_tag_index rewrites it) returns a status other than 200 OK or 404 Not Found. 404 is treated as 'no existing index' and returns an empty list; any other status aborts the tag update because the current contents cannot be determined.

Source

Thrown at src/oci/registry.rs:1544

            MEDIA_TYPE_OCI_MANIFEST,
            MEDIA_TYPE_DOCKER_MANIFEST,
        ]
        .join(", ");
        let resp = self
            .session
            .send(|auth| {
                let mut rb = HTTP.reqwest()?.get(&url).header("Accept", &accept);
                if let Some(a) = auth {
                    rb = rb.header("Authorization", a);
                }
                Ok(rb)
            })
            .await
            .wrap_err_with(|| format!("GET {url}"))?;
        match resp.status() {
            StatusCode::OK => {}
            StatusCode::NOT_FOUND => return Ok(vec![]),
            s => bail!("fetching current index for {url} failed: {}", s.as_u16()),
        }
        let content_type = header_str(&resp, "content-type");
        let bytes = resp.bytes().await?;
        let body: serde_json::Value = serde_json::from_slice(&bytes)?;

        // Already an index — take its entries.
        if body.get("manifests").map(|m| m.is_array()).unwrap_or(false) {
            let index: ImageIndex =
                serde_json::from_slice(&bytes).wrap_err("parsing existing image index")?;
            return Ok(index.manifests);
        }

        // A single-platform manifest: wrap it as an index entry so its
        // platform survives the upgrade to an index.
        match self
            .wrap_single_manifest(&bytes, &body, &content_type)
            .await
        {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Retry the push — this is most often a transient 5xx/429
  2. Fix credentials so the token has pull (read) access to the repository
  3. Check registry status/status-page if errors persist
  4. Bypass proxies or check corporate proxy health if the body shows proxy-generated errors
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight: confirm read access to the repo
let resp = client.get(format!("https://{registry}/v2/{repo}/manifests/{tag}")).send().await?;
if resp.status() == StatusCode::UNAUTHORIZED {
    bail!("token lacks pull scope for {repo}");
}

Try / catch

match result {
    Err(e) if e.to_string().contains("fetching current index") => {
        // treat 5xx/429 as transient
        retry_with_backoff(|| update_tag_index(...)).await
    }
    other => other,
}

Prevention

When it happens

Trigger: The GET of the manifest/index URL returns e.g. 401/403 (read not permitted with the current credential), 429 rate limit, or 5xx — anything besides 200 and 404.

Common situations: Token lacking pull scope for the repository when updating a tag; registry rate limiting during CI loops; transient registry outage mid-push; proxy returning 502/503.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/45065e6950c85f10. Report an issue: GitHub.