jdx/mise · error

tap formula name mismatch: requested '{name}', extracted '{}

Error message

tap formula name mismatch: requested '{name}', extracted '{}'

What it means

After evaluating a tap formula's Ruby definition, mise cross-checks that the name in the extracted metadata equals the formula name that was requested. A mismatch means the API snapshot, source path, and requested name are inconsistent — likely a wrong or stale metadata mapping — so mise returns the formula rather than proceeding with the wrong package.

Source

Thrown at src/system/packages/brew/tap.rs:96

            ("MISE_BREW_SOURCE_PATH", source_path.clone()),
            ("MISE_BREW_SOURCE_CHECKSUM", checksum),
            ("MISE_BREW_TAP_COMMIT", tap_source.commit),
            ("MISE_BREW_MACOS_VERSION", macos_version()),
            ("MISE_BREW_OS", std::env::consts::OS.to_string()),
            ("MISE_BREW_ARCH", std::env::consts::ARCH.to_string()),
        ])
        .with_timeout(METADATA_TIMEOUT)
        .with_sandbox(metadata_sandbox()?);
    runner.apply_sandbox().await?;
    let output = runner
        .read_bounded(METADATA_MAX_OUTPUT_BYTES)
        .await
        .wrap_err_with(|| format!("failed to evaluate {source_path}"))?;

    let formula: Formula = serde_json::from_str(&output)
        .wrap_err_with(|| format!("invalid metadata extracted from {source_path}"))?;
    if formula.name != name {
        bail!(
            "tap formula name mismatch: requested '{name}', extracted '{}'",
            formula.name
        );
    }
    Ok(formula)
}

pub(super) async fn cask_from_ruby(
    owner: &str,
    tap: &str,
    token: &str,
    tap_url: Option<&str>,
    provision_ruby: bool,
) -> Result<Cask> {
    validate_name(token)?;
    let tap_source = resolve_tap_source(owner, tap, tap_url).await?;
    let (source, source_path) = fetch_ruby_source(&tap_source.raw_base, "Casks", token).await?;
    let checksum = crate::hash::hash_sha256_to_str(&source);

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Clear the tap/metadata cache and re-fetch the current formula definitions
  2. Request the formula by its canonical name instead of an alias or old name
  3. Re-pull the tap so ruby_source_path points to the renamed .rb file
  4. If a third-party tap is internally inconsistent, report/fix the formula naming in the tap

Example fix

// before: mise.toml
"brew:old-name" = "1.0"  # renamed upstream to new-name
// after
"brew:new-name" = "1.0"
Defensive patterns

Strategy: validation

Validate before calling

if extracted.name != requested_name {
    eprintln!("tap metadata inconsistent; refetch tap");
}

Prevention

When it happens

Trigger: `formula_from_ruby` parses the JSON emitted by Ruby evaluation and `formula.name != name`, e.g. requesting `foo` while the .rb at ruby_source_path defines `bar`, or the tap renamed the formula and the metadata cache is stale.

Common situations: Formula renamed upstream in a third-party tap with cached metadata pointing to the old path; aliased formulas where an alias resolves to a differently-named definition; hand-edited metadata files.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


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