{"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":190,"sourceCode":"    pub(crate) 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":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/builder.rs#L172-L208","documentation":"The OCI builder resolves the container's mount point from the build request, then the project [oci] settings, then Settings::get().oci.default_mount_point. After trimming trailing slashes it refuses to continue if the resulting path is empty, because an empty mount point would map MISE_DATA_DIR to the container root and corrupt/confuse tool layout. This is a fail-fast validation before any image layers are built.","triggerScenarios":"Calling build (via send) when every source is empty: the request's mount_point is Some(\"\") or None, self.oci.mount_point is empty/None, and oci.default_mount_point in settings is an empty string (or only slashes, which trim to \"\").","commonSituations":"Users set `[oci] default_mount_point = \"\"` or `mount_point = \"/\"` in settings; a config template expands a variable to an empty string; a new install where the default was never populated.","solutions":["Set a valid absolute mount point in settings: `mise settings set oci.default_mount_point /mise` (or set [oci] mount_point in the project config).","If the build request sets mount_point, change it to a non-empty absolute path like \"/opt/mise-data\".","Check for config templating that resolves to an empty value (e.g. an unset env var interpolated into the setting)."],"exampleFix":"// before (settings.toml)\n[oci]\ndefault_mount_point = \"\"\n\n// after\n[oci]\ndefault_mount_point = \"/mise\"","handlingStrategy":"validation","validationCode":"let mp = std::env::var(\"MISE_OCI_DEFAULT_MOUNT_POINT\").unwrap_or_default();\nif mp.trim_end_matches('/').is_empty() {\n    return Err(\"oci mount_point must be set to a non-empty absolute path\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set oci.default_mount_point to an absolute path in settings.toml.","Never template mount_point from env vars that may be unset.","Add a CI check that renders the final settings and asserts mount_point is non-empty."],"tags":["oci","config","validation"],"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"}