{"record":{"id":"dd2da0d3fe71d7fe","repo":"jdx/mise","slug":"index-json-lists-no-manifests","errorCode":null,"errorMessage":"{}: index.json lists no manifests","messagePattern":"(.+?): index\\.json lists no manifests","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/registry.rs","lineNumber":948,"sourceCode":"    reference: &str,\n    update_index: bool,\n) -> Result<PushSummary> {\n    eyre::ensure!(\n        !crate::config::Settings::get().offline(),\n        \"offline mode is enabled\"\n    );\n    let r = Reference::parse(reference)?;\n    let layout = ImageLayout {\n        root: image_dir.to_path_buf(),\n    };\n\n    // Resolve the layout's single manifest. `mise oci build` always writes\n    // exactly one manifest into index.json.\n    let index_bytes = crate::file::read(image_dir.join(\"index.json\"))?;\n    let index: ImageIndex = serde_json::from_slice(&index_bytes).wrap_err(\"parsing index.json\")?;\n    let manifest_desc = match index.manifests.as_slice() {\n        [one] => one,\n        [] => bail!(\"{}: index.json lists no manifests\", image_dir.display()),\n        many => bail!(\n            \"{}: index.json lists {} manifests; multi-manifest layouts are not supported\",\n            image_dir.display(),\n            many.len()\n        ),\n    };\n    let manifest_bytes = layout.read_blob(&manifest_desc.digest)?;\n    let manifest: ImageManifest =\n        serde_json::from_slice(&manifest_bytes).wrap_err(\"parsing image manifest blob\")?;\n\n    // Cross-repo mount source: the base image's repository, when it lives on\n    // the destination registry (and isn't the destination repo itself).\n    let mount_from = manifest\n        .annotations\n        .get(ANNOTATION_BASE_NAME)\n        .and_then(|name| Reference::parse(name).ok())\n        .filter(|base| base.registry == r.registry && base.repository != r.repository)\n        .map(|base| base.repository);","sourceCodeStart":930,"sourceCodeEnd":966,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/registry.rs#L930-L966","documentation":"Thrown during `push_image` when the OCI image layout's `index.json` contains an empty `manifests` array. The pusher requires exactly one manifest descriptor to upload and cannot proceed with an empty index.","triggerScenarios":"Calling push on an image directory whose `index.json` was produced empty — e.g. a truncated/interrupted `mise oci build`, or a hand-crafted layout with no manifests entry.","commonSituations":"Pointing the push command at the wrong directory (a bare blob store instead of a built image layout); a build that failed before writing the manifest; manually editing index.json and deleting the manifest entry.","solutions":["Rebuild the image with `mise oci build` so a fresh, valid index.json is generated.","Check you are pushing the correct image directory (the one containing blobs/ and a populated index.json).","Inspect index.json (`cat <dir>/index.json | jq .manifests`) to confirm it has exactly one entry."],"exampleFix":"// before: empty index\n{ \"manifests\": [] }\n// after: index with one manifest descriptor\n{ \"manifests\": [ { \"mediaType\": \"application/vnd.oci.image.manifest.v1+json\", \"digest\": \"sha256:...\", \"size\": 1234 } ] }","handlingStrategy":"validation","validationCode":"let index: serde_json::Value = serde_json::from_slice(\n    &std::fs::read(image_dir.join(\"index.json\"))?,\n)?;\nlet n = index[\"manifests\"].as_array().map(|a| a.len()).unwrap_or(0);\nif n != 1 { eprintln!(\"index.json has {n} manifests; rebuild the image\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build layouts with `mise oci build` rather than hand-editing index.json.","Verify `jq '.manifests | length' index.json` equals 1 before pushing.","Guard CI so a failed build artifact is never passed to the push step."],"tags":["oci","image-layout","validation","push"],"backgroundTag":"empty-required-field","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}