{"record":{"id":"40670066f6bf01d3","repo":"jdx/mise","slug":"oci-mount-point-must-not-be-empty","errorCode":null,"errorMessage":"oci mount_point must not be empty","messagePattern":"oci mount_point must not be empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/builder.rs","lineNumber":178,"sourceCode":"    pub async fn build(self) -> Result<BuildOutput> {\n        let versions = self.ts.list_current_versions();\n        if versions.is_empty() {\n            warn!(\"mise oci build: no tools in the toolset — image will have only the base layer\");\n        }\n        reject_unsupported_backends(&versions)?;\n\n        file::create_dir_all(&self.opts.out_dir)?;\n        let layout = ImageLayout::init(&self.opts.out_dir)?;\n\n        let mount_point = self\n            .opts\n            .mount_point\n            .clone()\n            .or_else(|| self.oci.mount_point.clone())\n            .unwrap_or_else(|| Settings::get().oci.default_mount_point.clone());\n        let mount_point = mount_point.trim_end_matches('/').to_string();\n        if mount_point.is_empty() {\n            bail!(\"oci mount_point must not be empty\");\n        }\n        if !mount_point.starts_with('/') {\n            bail!(\n                \"oci mount_point must be an absolute path (got {mount_point:?}); \\\n                 a relative value makes MISE_DATA_DIR inside the container \\\n                 depend on the working directory and mis-resolve tools.\"\n            );\n        }\n\n        let owner = resolve_layer_owner(self.opts.owner, &self.oci);\n        let copies: Vec<&OciCopy> = self.oci.copy.iter().chain(&self.opts.copy).collect();\n\n        // --- 1. Base image (optional) ---\n        let from_ref = self\n            .opts\n            .from\n            .clone()\n            .or_else(|| self.oci.from.clone())","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/oci/builder.rs#L160-L196","documentation":"During `mise oci build`, the in-image install path (mount point) is resolved from build opts, then mise.toml `[oci] mount_point`, then the `oci.default_mount_point` setting (default `/mise`), and trailing '/' characters are trimmed. If the trimmed result is empty — classically `mount_point = \"/\"` — the build refuses to continue because tools cannot be mounted at an empty path. The image's MISE_DATA_DIR is set from this value, so emptiness is fatal.","triggerScenarios":"Setting `mount_point = \"/\"` (or `//`) in `[oci]` of mise.toml or in build opts; or configuring `oci.default_mount_point` to `/`, which trims to empty. Both `mise oci build` invocations and programmatic builder use hit the check before any layer work starts.","commonSituations":"Attempting to install tools at the image root '/' for a minimal container; copy-pasted configs; intentionally-absolute-but-degenerate values like `\"/\"`.","solutions":["Set a real directory such as `mount_point = \"/mise\"` or `\"/opt/mise\"` in `[oci]` of mise.toml (or the build options)","If overriding the default globally, set `oci.default_mount_point` (env MISE_OCI_DEFAULT_MOUNT_POINT) to a non-root absolute path","Remove the override entirely to fall back to the default `/mise`"],"exampleFix":"# before (mise.toml)\n[oci]\nmount_point = \"/\"\n\n# after (mise.toml)\n[oci]\nmount_point = \"/mise\"","handlingStrategy":"validation","validationCode":"python3 - <<'EOF'\nimport tomllib, sys\ncfg = tomllib.load(open('mise.toml', 'rb'))\nmp = cfg.get('oci', {}).get('mount_point', '/mise').rstrip('/')\nif not mp: sys.exit('mount_point trims to empty — set e.g. \"/mise\"')\nprint('mount_point OK:', mp)\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set mount_point to \"/\" — tools need their own directory","Keep the default `/mise` unless you have a reason to change it","Validate oci sections of mise.toml in CI before image builds"],"tags":["oci","build","config","validation","mount-point"],"backgroundTag":"config-validation-failed","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}