jdx/mise · error

: index.json lists no manifests

Error message

{}: index.json lists no manifests

What it means

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.

Solutions

  1. Rebuild the image with `mise oci build` so a fresh, valid index.json is generated.
  2. Check you are pushing the correct image directory (the one containing blobs/ and a populated index.json).
  3. Inspect index.json (`cat <dir>/index.json | jq .manifests`) to confirm it has exactly one entry.

Example fix

// before: empty index
{ "manifests": [] }
// after: index with one manifest descriptor
{ "manifests": [ { "mediaType": "application/vnd.oci.image.manifest.v1+json", "digest": "sha256:...", "size": 1234 } ] }
Defensive patterns

Strategy: validation

Validate before calling

let index: serde_json::Value = serde_json::from_slice(
    &std::fs::read(image_dir.join("index.json"))?,
)?;
let n = index["manifests"].as_array().map(|a| a.len()).unwrap_or(0);
if n != 1 { eprintln!("index.json has {n} manifests; rebuild the image"); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/dd2da0d3fe71d7fe. Report an issue: GitHub.

Appendix: source

Thrown at src/oci/registry.rs:948

    reference: &str,
    update_index: bool,
) -> Result<PushSummary> {
    eyre::ensure!(
        !crate::config::Settings::get().offline(),
        "offline mode is enabled"
    );
    let r = Reference::parse(reference)?;
    let layout = ImageLayout {
        root: image_dir.to_path_buf(),
    };

    // Resolve the layout's single manifest. `mise oci build` always writes
    // exactly one manifest into index.json.
    let index_bytes = crate::file::read(image_dir.join("index.json"))?;
    let index: ImageIndex = serde_json::from_slice(&index_bytes).wrap_err("parsing index.json")?;
    let manifest_desc = match index.manifests.as_slice() {
        [one] => one,
        [] => bail!("{}: index.json lists no manifests", image_dir.display()),
        many => bail!(
            "{}: index.json lists {} manifests; multi-manifest layouts are not supported",
            image_dir.display(),
            many.len()
        ),
    };
    let manifest_bytes = layout.read_blob(&manifest_desc.digest)?;
    let manifest: ImageManifest =
        serde_json::from_slice(&manifest_bytes).wrap_err("parsing image manifest blob")?;

    // Cross-repo mount source: the base image's repository, when it lives on
    // the destination registry (and isn't the destination repo itself).
    let mount_from = manifest
        .annotations
        .get(ANNOTATION_BASE_NAME)
        .and_then(|name| Reference::parse(name).ok())
        .filter(|base| base.registry == r.registry && base.repository != r.repository)
        .map(|base| base.repository);

View on GitHub (pinned to 533346cc37)