jdx/mise · error

validated registry min_version

Error message

validated registry min_version

What it means

This is an internal invariant panic in mise's registry version check (src/registry.rs supports_version). Each registry entry carries a min_version, and the loader is expected to have already validated it parses as semver. When a request's version string is compared against that minimum, parse(minimum).expect fires if the stored minimum was never validated — meaning invalid registry data reached this code path.

Source

Thrown at src/registry.rs:183

}

#[derive(Debug, Clone)]
pub(crate) struct RegistryBackend {
    pub full: &'static str,
    pub platforms: &'static [&'static str],
    pub min_version: Option<&'static str>,
    pub options: &'static [(&'static str, &'static str)],
}

impl RegistryBackend {
    fn supports_version(&self, request: &str) -> bool {
        let Some(minimum) = self.min_version else {
            return true;
        };
        // Validated when loading both bundled and floating registries. This
        // boundary is explicitly restricted to semver tools; it never orders
        // backend version lists or interprets opaque lockfile versions.
        let minimum = semver::Version::parse(minimum).expect("validated registry min_version");
        let request = request.strip_prefix("prefix:").unwrap_or(request);
        let request = request.trim_start_matches(['v', 'V']);
        if let Ok(version) = semver::Version::parse(request) {
            return !version.cmp_precedence(&minimum).is_lt();
        }
        // A numeric prefix is excluded only when the entire prefix is below
        // the boundary. Let the backend resolve prefixes that overlap it.
        let parts = request.split('.').collect::<Vec<_>>();
        if !(1..=2).contains(&parts.len()) {
            return true;
        }
        let Some(parts) = parts
            .into_iter()
            .map(|part| {
                if part.is_empty()
                    || !part.bytes().all(|c| c.is_ascii_digit())
                    || (part.len() > 1 && part.starts_with('0'))
                {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Locate the registry entry whose min_version is invalid and fix it to a valid semver string (e.g. '1.2.0', not 'v1.2' or 'latest').
  2. Run the registry validation (mise's registry loading/validation step) to identify the offending entry.
  3. If using a custom/floating registry, update it to a version whose min_version is valid, or pin the bundled registry copy.
  4. Report a bug if this occurs with the bundled registry — it indicates the load-time validation invariant is broken.

Example fix

// registry/ node with invalid min_version
// before
[tools.node]
min_version = "v18"
// after
[tools.node]
min_version = "18.0.0"
Defensive patterns

Strategy: validation

Validate before calling

// before trusting a registry entry
fn valid_min_version(e: &RegistryEntry) -> bool {
    e.min_version.as_deref().map(|v| semver::Version::parse(v).is_ok()).unwrap_or(true)
}

Prevention

When it happens

Trigger: A registry (bundled or floating/user-supplied) is loaded with a min_version that bypassed or evaded load-time semver validation, then supports_version is called with a version request (e.g. checking whether registry entry supports 'prefix:1.2' or a 'v'-prefixed version).

Common situations: Hand-edited or third-party floating registry files with typos in min_version; a regression in registry load validation; tool versions with non-semver conventions interacting with a bad stored minimum.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/b0fa770105efd57f. Report an issue: GitHub.