{"record":{"id":"4332a8dce9512c2d","repo":"jdx/mise","slug":"does-not-look-like-an-oci-image-layout-missin-4332a8","errorCode":null,"errorMessage":"{}: does not look like an OCI image layout (missing index.json)","messagePattern":"(.+?): does not look like an OCI image layout \\(missing index\\.json\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/oci/run.rs","lineNumber":117,"sourceCode":"    cmd: Vec<String>,\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, usage_rs::ValueEnum)]\nenum Engine {\n    Auto,\n    Podman,\n    Docker,\n}\n\nimpl Run {\n    pub(super) async fn run(self) -> Result<()> {\n        Settings::get().ensure_experimental(\"mise oci run\")?;\n\n        // 1. Validate arguments first so bad args win over \"engine missing\".\n        if let Some(d) = &self.image_dir\n            && !d.join(\"index.json\").is_file()\n        {\n            bail!(\n                \"{}: does not look like an OCI image layout (missing index.json)\",\n                d.display()\n            );\n        }\n\n        // 2. Locate a container engine.\n        let engine = select_engine(self.engine)?;\n\n        // 3. Build (or reuse an existing layout). When building, keep the\n        // `TempDir` alive for the duration of the command — it removes the\n        // directory on drop, so partial-gigabyte tool layers don't pile up\n        // in /tmp across invocations.\n        let (image_dir, _tempdir_guard): (PathBuf, Option<TempDir>) =\n            if let Some(d) = &self.image_dir {\n                (d.clone(), None)\n            } else {\n                let td = TempDir::with_prefix(\"mise-oci-run-\")\n                    .wrap_err(\"creating temp dir for oci build output\")?;","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/oci/run.rs#L99-L135","documentation":"`mise oci run --image-dir <dir>` validates the directory is a valid OCI image layout by requiring index.json before locating a container engine. Argument validation is deliberately done first so bad --image-dir values surface before any engine-missing errors.","triggerScenarios":"Running `mise oci run --image-dir <dir>` where <dir>/index.json is not a regular file — wrong directory, incomplete build output, or a deleted temp layout.","commonSituations":"Pointing --image-dir at the wrong path after a build, running from a different machine/tmpfs where the build's temp layout was cleaned up, or passing a tarball path instead of a directory.","solutions":["Pass the OCI layout directory produced by `mise oci build` (the one containing index.json)","Rebuild the image with `mise oci build` if the layout was deleted","Verify with `test -f <dir>/index.json` before invoking mise oci run"],"exampleFix":"// before\nmise oci run --image-dir ./image.tar ...\n// after\nmise oci run --image-dir ./target/oci-image ...\n# where ./target/oci-image/index.json exists","handlingStrategy":"validation","validationCode":"test -f \"$image_dir/index.json\" || { echo \"$image_dir is not an OCI layout\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run mise oci build in the same session/machine as oci run, or persist the layout to a known dir","Pass directories (not .tar files) to --image-dir","Script the build->run handoff so the layout path is passed explicitly"],"tags":["oci","file-not-found","docker"],"backgroundTag":"file-not-found","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"}