jdx/mise · error

brew-cask:{}: {kind} terminate_process match must be name or

Error message

brew-cask:{}: {kind} terminate_process match must be name or full

What it means

The optional `match` key of a `terminate_process` flight step controls whether `name` matches the process name or the full command line. Only the strings `"name"` and `"full"` are accepted; any other value (including non-strings like numbers or booleans) is rejected with this error.

Source

Thrown at src/system/packages/brew/cask/artifacts.rs:774

                ],
            )?;
            let name = object.get("name").and_then(Value::as_str).ok_or_else(|| {
                eyre!(
                    "brew-cask:{}: {kind} terminate_process name must be a string",
                    cask.token
                )
            })?;
            if name.is_empty() {
                bail!(
                    "brew-cask:{}: {kind} terminate_process name must not be empty",
                    cask.token
                );
            }
            let match_mode = match object.get("match") {
                None => ProcessMatch::Name,
                Some(Value::String(value)) if value == "name" => ProcessMatch::Name,
                Some(Value::String(value)) if value == "full" => ProcessMatch::Full,
                _ => bail!(
                    "brew-cask:{}: {kind} terminate_process match must be name or full",
                    cask.token
                ),
            };
            let sudo = parse_optional_flight_bool(cask, kind, object, "sudo", false)?;
            let must_succeed =
                parse_optional_flight_bool(cask, kind, object, "must_succeed", false)?;
            let attempts = match object.get("attempts") {
                None => 1,
                Some(value) => value
                    .as_u64()
                    .and_then(|value| usize::try_from(value).ok())
                    .filter(|value| *value > 0)
                    .ok_or_else(|| {
                        eyre!(
                            "brew-cask:{}: {kind} terminate_process attempts must be a positive integer",
                            cask.token
                        )

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Change `match` to exactly "name" (default, process-name match) or "full" (full command-line match).
  2. Remove the `match` key entirely to get the default `name` matching.
  3. Check spelling: "full_path" and "fullname" are not valid; only "name" and "full".

Example fix

// before
[[install.flight_steps]]
type = "terminate_process"
name = "MyApp"
match = "full_path"
// after
[[install.flight_steps]]
type = "terminate_process"
name = "MyApp"
match = "full"
Defensive patterns

Strategy: validation

Validate before calling

const VALID_MATCH = new Set(['name', 'full']);
function validateMatch(step) {
  if ('match' in step && !VALID_MATCH.has(step.match)) {
    throw new Error(`terminate_process match must be 'name' or 'full', got ${JSON.stringify(step.match)}`);
  }
}

Type guard

const isValidMatch = (m) => m === undefined || m === 'name' || m === 'full';

Prevention

When it happens

Trigger: A cask defines `match = "exe"`, `match = "path"`, `match = true`, or any value other than the literal strings "name" or "full" in a terminate_process step, and parse_flight_step hits the catch-all bail arm.

Common situations: Copy-pasting Homebrew Ruby cask semantics (which may use different match vocabulary) into mise cask definitions; typos like "fullpath" or "full_path"; accidentally quoting issues that produce unexpected types.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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