jdx/mise · error

brew-cask:{}: {kind} terminate_process notices must be an ar

Error message

brew-cask:{}: {kind} terminate_process notices must be an array

What it means

The `notices` field of a `terminate_process` flight step must be an array of strings. When `notices` is present but is any other JSON/TOML type (string, object, number, bool), the parser bails with this error rather than guessing an interpretation.

Source

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

                            "brew-cask:{}: {kind} terminate_process attempts must be a positive integer",
                            cask.token
                        )
                    })?,
            };
            let notices = match object.get("notices") {
                None => Vec::new(),
                Some(Value::Array(values)) => values
                    .iter()
                    .map(|value| {
                        value.as_str().map(str::to_string).ok_or_else(|| {
                            eyre!(
                                "brew-cask:{}: {kind} terminate_process notices must be strings",
                                cask.token
                            )
                        })
                    })
                    .collect::<Result<Vec<_>>>()?,
                Some(_) => bail!(
                    "brew-cask:{}: {kind} terminate_process notices must be an array",
                    cask.token
                ),
            };
            let failure_message = match object.get("failure_message") {
                None | Some(Value::Null) => None,
                Some(Value::String(value)) => Some(value.clone()),
                Some(_) => bail!(
                    "brew-cask:{}: {kind} terminate_process failure_message must be a string",
                    cask.token
                ),
            };
            Ok(FlightStep::TerminateProcess {
                name: name.to_string(),
                match_mode,
                sudo,
                attempts,
                must_succeed,

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Wrap the message in an array: `notices = ["msg"]`.
  2. Remove the `notices` key if no notices are needed.
  3. Ensure every element of the array is a string (see the related 'notices must be strings' error).

Example fix

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

Strategy: type-guard

Validate before calling

function validateNotices(step) {
  if ('notices' in step && !Array.isArray(step.notices)) {
    throw new Error(`terminate_process notices must be an array of strings, got ${typeof step.notices}`);
  }
}

Type guard

const isNoticesArray = (n) => n === undefined || (Array.isArray(n) && n.every((x) => typeof x === 'string'));

Try / catch

try {
  parseFlightStep(raw);
} catch (e) {
  if (String(e).includes('notices must be an array')) {
    fix.notices = [String(raw.notices)];
  } else throw e;
}

Prevention

When it happens

Trigger: A cask sets `notices = "some message"` (a plain string instead of an array), or an object/number/bool, in a terminate_process step; parse_flight_step's `Some(_)` arm fires.

Common situations: Author confusion between singular 'notice' string vs plural 'notices' array; conversion tools that collapse a single-element list; hand-editing and dropping the brackets.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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