jdx/mise · error

Homebrew now owns this cask

Error message

Homebrew now owns this cask

What it means

validate_cask_prune_candidate verifies a mise-owned cask is still safe to prune directly. First check: if Homebrew metadata for the token is now present, Homebrew has taken ownership and mise must not delete artifacts itself, so it bails with this short message. This is a safety precondition for direct-artifact pruning.

Source

Thrown at src/system/packages/brew/cask/state.rs:1032

        }
    }
    for target in &candidate.receipt.targets {
        if claims
            .get(&target.path)
            .is_some_and(|tokens| tokens.iter().any(|token| token != &candidate.token))
        {
            bail!(
                "artifact target is now claimed by another cask: {}",
                target.path.display()
            );
        }
    }
    Ok(())
}

pub(super) fn validate_cask_prune_candidate(candidate: &CaskPruneCandidate) -> Result<()> {
    if homebrew_metadata_present(&candidate.token)? {
        bail!("Homebrew now owns this cask");
    }
    let receipt = &candidate.receipt;
    if read_receipt(&candidate.version_dir)?.as_ref() != Some(receipt) {
        bail!("ownership receipt has changed");
    }
    if receipt.schema_version != 3 || !receipt.prune_safe || !receipt.pkg_ids.is_empty() {
        bail!("receipt is not marked safe for direct-artifact pruning");
    }
    if !receipt.metadata_only_apps.is_empty() {
        bail!("metadata-only app ownership cannot be proven safely during pruning");
    }
    let records = receipt
        .targets
        .iter()
        .map(|record| (record.path.clone(), record))
        .collect::<BTreeMap<_, _>>();
    let expected = receipt.standard_targets().cloned().collect::<BTreeSet<_>>();
    if expected.is_empty()

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Let Homebrew manage it now: use `brew uninstall --cask <token>` if removal is the goal
  2. Use Homebrew-driven workflows for this cask going forward instead of mise direct-artifact pruning
  3. If mise should own it again, remove Homebrew's metadata/instance and reinstall through mise

Example fix

// before: pruning a cask that brew now owns
mise cask prune <token>   # "Homebrew now owns this cask"
// after
brew uninstall --cask <token>
Defensive patterns

Strategy: validation

Validate before calling

// before pruning, confirm mise still owns the token
brew info --cask <token> >/dev/null 2>&1 && echo "brew owns it; use brew uninstall" || echo "safe to prune via mise"

Prevention

When it happens

Trigger: cask_prune_plan_from_tokens or apply_cask_prune_plan_in calls validate_cask_prune_candidate and homebrew_metadata_present(&candidate.token) returns true — Homebrew (re)installed the cask after mise's receipt was written.

Common situations: User ran `brew install --cask` on a token mise previously managed; brew autoupdate adopted the cask; cask migrated from mise ownership to Homebrew between operations.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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