{"record":{"id":"459ab5588f47c2b9","repo":"jdx/mise","slug":"could-not-determine-os-release","errorCode":null,"errorMessage":"could not determine OS release","messagePattern":"could not determine OS release","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/erlang.rs","lineNumber":236,"sourceCode":"                \"ubuntu-26.04\",\n            ]\n            .contains(&os.as_str())\n            {\n                bail!(\"unsupported OS version: {os}\");\n            }\n            return Ok(os);\n        } else if Platform::current().is_linux() {\n            if let Ok(os) = std::env::var(\"ImageOS\") {\n                match os.as_str() {\n                    \"ubuntu24\" => \"ubuntu-24.04\".to_string(),\n                    \"ubuntu22\" => \"ubuntu-22.04\".to_string(),\n                    \"ubuntu20\" => \"ubuntu-20.04\".to_string(),\n                    _ => os,\n                }\n            } else if let Some(os_release) = linux_os_release() {\n                format!(\"{}-{}\", os_release.id, os_release.version_id)\n            } else {\n                bail!(\"could not determine OS release\");\n            }\n        } else {\n            // Cross-platform Linux lock resolution cannot inspect the target\n            // distro, so use Bob's newest supported Ubuntu build.\n            \"ubuntu-24.04\".to_string()\n        };\n\n        // Keep automatic targets stable so existing optionless source locks continue to match.\n        // Other targets and glibc distributions can opt in with erlang.precompiled_os.\n        if ![\"ubuntu-20.04\", \"ubuntu-22.04\", \"ubuntu-24.04\"].contains(&os_ver.as_str()) {\n            bail!(\"unsupported OS version: {os_ver}\");\n        }\n        Ok(os_ver)\n    }\n\n    fn macos_asset_name(target: &PlatformTarget) -> Result<String> {\n        let arch = match target.arch_name() {\n            \"x64\" => \"x86_64\",","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/core/erlang.rs#L218-L254","documentation":"mise needs to know the target Linux distribution (id-version, e.g. ubuntu-24.04) to pick the right precompiled Erlang build. When not on Linux (cross-platform lock resolution path shown here is the fallback, but on Linux without ImageOS) and /etc/os-release cannot be parsed, mise cannot determine which build to select and bails.","triggerScenarios":"`mise install erlang@<version>` (or lock resolution) on Linux where neither the ImageOS env var nor a parseable /etc/os-release file exists — e.g. minimal/minimal-images containers without os-release, or exotic distros.","commonSituations":"Scratch/distroless Docker images lacking /etc/os-release; heavily stripped container images; custom minimal Linux builds.","solutions":["Install the base-files/os-release package or restore /etc/os-release (e.g. `apt-get install base-files` on Debian-based images)","Set the ImageOS env var to a supported value (e.g. ubuntu24) as a workaround","Use a standard distro base image (ubuntu:24.04) for the install step","Compile from source, which still needs os-release only for lock resolution — avoid cross-target lock resolution"],"exampleFix":"# before\nFROM scratch  # no /etc/os-release\n# after\nFROM ubuntu:24.04  # provides /etc/os-release\nRUN mise install erlang@26.2","handlingStrategy":"fallback","validationCode":"test -f /etc/os-release && echo \"os-release present\" || echo \"restore os-release or set ImageOS\"","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if (/could not determine OS release/.test(String(e))) {\n    // use standard base image or set ImageOS=ubuntu24 then retry\n  }\n}","preventionTips":["Avoid distroless/scratch images for mise install steps","Keep base-files/os-release installed in minimal images","Set ImageOS explicitly in containerized CI as a deterministic fallback"],"tags":["erlang","linux","os-release","environment"],"backgroundTag":"missing-env-var","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"}