{"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":224,"sourceCode":"            Self::linux_precompiled_os_version().ok()\n        } else {\n            None\n        }\n    }\n\n    fn linux_precompiled_os_version() -> Result<String> {\n        let os_ver = 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        // Currently, Bob only builds for Ubuntu, so we have to check that we're on Ubuntu,\n        // and on a supported version.\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":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/plugins/core/erlang.rs#L206-L242","documentation":"To choose the hex.pm Ubuntu build, mise must identify the distro: first the GitHub Actions ImageOS env var, then /etc/os-release (ID + VERSION_ID via linux_os_release). If neither yields a string, it cannot form the builds.txt URL and bails. Only fatal with erlang.compile=false; otherwise the install quietly falls back to compiling from source.","triggerScenarios":"`mise install erlang` (with compile=false) inside a stripped container that has no parsable /etc/os-release and no ImageOS env: distroless images, scratch-based images, some embedded/minimal BusyBox rootfs, or an os-release file missing ID/VERSION_ID fields.","commonSituations":"Hardened Docker images built by removing docs/metadata; CI runners built from scratch rootfs; chroot/proot environments where /etc/os-release was not mounted.","solutions":["Export the GitHub Actions-style hint: `ImageOS=ubuntu24 mise install erlang@27.1` (maps to the ubuntu-24.04 build)","Base the image on Ubuntu/Debian so /etc/os-release exists with ID and VERSION_ID","Or sidestep distro detection: `mise settings set erlang.compile true`"],"exampleFix":"# before\n$ docker run --rm my-distroless-image mise install erlang@27.1\nERROR: could not determine OS release\n\n# after\n$ docker run --rm -e ImageOS=ubuntu24 my-distroless-image mise install erlang@27.1","handlingStrategy":"validation","validationCode":"# make distro detection possible in minimal containers\nif [ ! -r /etc/os-release ] && [ -z \"${ImageOS:-}\" ]; then\n  export ImageOS=ubuntu24   # only valid if the runtime really is ubuntu-24.04 glibc\nfi\nmise install erlang@27.1","typeGuard":"has_os_identity() { [ -n \"${ImageOS:-}\" ] || grep -q '^ID=' /etc/os-release 2>/dev/null; }","tryCatchPattern":null,"preventionTips":["Don't strip /etc/os-release when shrinking Docker images — many tools need it","In GitHub Actions runners the ImageOS var is set automatically; reproduce it in custom containers"],"tags":["mise","erlang","os-release","distroless","container","github-actions"],"backgroundTag":"missing-os-release","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}