{"record":{"id":"45065e6950c85f10","repo":"jdx/mise","slug":"fetching-current-index-for-url-failed","errorCode":null,"errorMessage":"fetching current index for {url} failed: {}","messagePattern":"fetching current index for (.+?) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/registry.rs","lineNumber":1544,"sourceCode":"            MEDIA_TYPE_OCI_MANIFEST,\n            MEDIA_TYPE_DOCKER_MANIFEST,\n        ]\n        .join(\", \");\n        let resp = self\n            .session\n            .send(|auth| {\n                let mut rb = HTTP.reqwest()?.get(&url).header(\"Accept\", &accept);\n                if let Some(a) = auth {\n                    rb = rb.header(\"Authorization\", a);\n                }\n                Ok(rb)\n            })\n            .await\n            .wrap_err_with(|| format!(\"GET {url}\"))?;\n        match resp.status() {\n            StatusCode::OK => {}\n            StatusCode::NOT_FOUND => return Ok(vec![]),\n            s => bail!(\"fetching current index for {url} failed: {}\", s.as_u16()),\n        }\n        let content_type = header_str(&resp, \"content-type\");\n        let bytes = resp.bytes().await?;\n        let body: serde_json::Value = serde_json::from_slice(&bytes)?;\n\n        // Already an index — take its entries.\n        if body.get(\"manifests\").map(|m| m.is_array()).unwrap_or(false) {\n            let index: ImageIndex =\n                serde_json::from_slice(&bytes).wrap_err(\"parsing existing image index\")?;\n            return Ok(index.manifests);\n        }\n\n        // A single-platform manifest: wrap it as an index entry so its\n        // platform survives the upgrade to an index.\n        match self\n            .wrap_single_manifest(&bytes, &body, &content_type)\n            .await\n        {","sourceCodeStart":1526,"sourceCodeEnd":1562,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/oci/registry.rs#L1526-L1562","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry the push — this is most often a transient 5xx/429","Fix credentials so the token has pull (read) access to the repository","Check registry status/status-page if errors persist","Bypass proxies or check corporate proxy health if the body shows proxy-generated errors"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight: confirm read access to the repo\nlet resp = client.get(format!(\"https://{registry}/v2/{repo}/manifests/{tag}\")).send().await?;\nif resp.status() == StatusCode::UNAUTHORIZED {\n    bail!(\"token lacks pull scope for {repo}\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"fetching current index\") => {\n        // treat 5xx/429 as transient\n        retry_with_backoff(|| update_tag_index(...)).await\n    }\n    other => other,\n}","preventionTips":["Ensure credentials have both pull and push scopes (tag update needs read of current index)","Add retry/backoff around pushes in CI to survive rate limits and transient 5xx","Check registry status pages before bulk tag operations"],"tags":["oci","registry","http","fetch","tag"],"backgroundTag":"http-error-response","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}