jdx/mise · error

brew-cask:{}: {kind} terminate_process name must not be empt

Error message

brew-cask:{}: {kind} terminate_process name must not be empty

What it means

While parsing a brew cask artifact flight step (install/uninstall/postflight-style steps), mise requires the `name` key of a `terminate_process` step to be a non-empty string. The name identifies the process to terminate, so an empty string would produce a step that can never match anything. The parser bails with this error instead of silently accepting a useless step.

Source

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

                object,
                &[
                    "type",
                    "name",
                    "match",
                    "sudo",
                    "attempts",
                    "must_succeed",
                    "notices",
                    "failure_message",
                ],
            )?;
            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") {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Set a non-empty `name` on the terminate_process step, e.g. the process name or full executable path.
  2. Remove the terminate_process step entirely if no process needs terminating.
  3. Check for empty variables/templating that yield an empty string and fix the substitution.
  4. Validate the cask file with the mise parser before shipping it.

Example fix

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

Strategy: validation

Validate before calling

function validateTerminateName(step) {
  if (typeof step?.name !== 'string' || step.name.trim() === '') {
    throw new Error(`terminate_process step requires a non-empty string name (got ${JSON.stringify(step?.name)})`);
  }
}

Type guard

const hasTerminateName = (s) => typeof s?.name === 'string' && s.name.length > 0;

Prevention

When it happens

Trigger: A cask artifact defines a `terminate_process` step whose `name` field is present but set to an empty string (e.g. `name = ""`). parse_flight_step rejects it after confirming `name` is a string.

Common situations: Hand-editing a cask definition and clearing the process name; templating that substitutes an empty value; copying a step and deleting the name value; migrating casks from Homebrew where the plist bundle identifier was optional.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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