jdx/mise · error

unrecognized version

Error message

unrecognized {preset} version: {version}

What it means

major() parses the `--version` output of a preset's binary to extract the major version; it first strips a `v=` (or similar) prefix from the output, then requires the major segment to be non-empty and all digits. If the version string does not match, the output is considered unrecognized for that preset.

Solutions

  1. Ensure the real preset binary (not a wrapper) is on PATH and prints a standard version like 'x.y.z' or 'v=x.y.z'
  2. Fix PATH so mise resolves the official binary
  3. Check the binary runs correctly outside mise (`<binary> --version`)

Example fix

// shell before: postgres --version prints "custom build"
// after: resolve official binary so output is e.g. "postgres (PostgreSQL) 16.3"
PATH=/usr/lib/postgresql/16/bin:$PATH mise daemon start
Defensive patterns

Strategy: validation

Validate before calling

# verify the binary reports a parseable version first
<binary> --version | grep -Eo '[0-9]+\.[0-9]+' || echo 'unparseable version output'

Try / catch

catch (e) { if (/unrecognized .* version/.test(e.message)) { checkBinaryOnPath(); } }

Prevention

When it happens

Trigger: Running a preset binary's --version whose stdout lacks a parseable version (builds without version info, custom/patched binaries printing unexpected text), called during daemon initialize.

Common situations: A PATH-shimmed or wrapper postgres binary printing a custom banner; a very old or nonstandard build whose version line format differs; locale-modified output.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/3f5a78961f7cece9. Report an issue: GitHub.

Appendix: source

Thrown at src/daemons/presets.rs:171

        preset: Some(preset_name.into()),
        tool: Some((tool, version.into())),
        exports,
    })
}

/// Database compatibility is preset-specific; tool request strings remain opaque.
fn major(preset: &str, output: &str) -> Result<String> {
    let version = match preset {
        "postgres" => output.trim().strip_prefix("postgres (PostgreSQL) "),
        "redis" => output
            .split_whitespace()
            .find_map(|part| part.strip_prefix("v=")),
        _ => None,
    }
    .ok_or_else(|| eyre::eyre!("unrecognized {preset} version output: {output}"))?;
    let major = version.split('.').next().unwrap_or_default();
    if major.is_empty() || !major.chars().all(|c| c.is_ascii_digit()) {
        bail!("unrecognized {preset} version: {version}");
    }
    Ok(major.into())
}

pub(crate) fn initialize(preset_name: &str, data: &Path, database: &str) -> Result<()> {
    crate::config::Settings::get().ensure_experimental("daemon presets")?;
    crate::config::Settings::ensure_not_safe("initializing daemon data")?;
    if cfg!(windows) {
        bail!("daemon presets are not supported on Windows yet");
    }
    let preset = preset(preset_name)?;
    let parent = data
        .parent()
        .ok_or_else(|| eyre::eyre!("daemon data must have a parent directory"))?;
    std::fs::create_dir_all(parent)?;
    let _lock = crate::lock_file::LockFile::new(data).lock()?;
    let output = Command::new(&preset.binary).arg("--version").output()?;
    if !output.status.success() {

View on GitHub (pinned to 533346cc37)