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
Thrown while parsing a terminate_process step. The optional 'notices' key must be an array of strings (user-facing notes shown before the process is terminated). Supplying any non-array JSON value — a bare string, number, or object — hits the Some(_) arm and bails. (Array entries that are not strings produce the sibling 'notices must be strings' error.)
Source
Thrown at src/system/packages/brew/cask.rs:5764
"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 6f52dcdf99)
Solutions
- Wrap notices in an array of strings: "notices": ["This will close the app"]
- Omit the key entirely if there are no notices (it defaults to an empty list)
Example fix
// before
{"type": "terminate_process", "name": "x", "notices": "will restart the app"}
// after
{"type": "terminate_process", "name": "x", "notices": ["will restart the app"]} Defensive patterns
Strategy: validation
Validate before calling
fn notices_ok(step: &serde_json::Value) -> bool {
match step.get("notices") {
None => true,
Some(serde_json::Value::Array(_)) => true,
Some(_) => false,
}
} Try / catch
match parse_flight_step(&cask, kind, &step) {
Ok(step) => { /* proceed */ }
Err(e) if e.to_string().contains("notices must be an array") => {
eprintln!("wrap each notice in a one-element array of strings");
}
Err(e) => return Err(e),
} Prevention
- Always emit notices as arrays, even for a single message
- Check that templating does not collapse one-element lists to scalars
When it happens
Trigger: {"type": "terminate_process", "name": "x", "notices": "closing app"} or "notices": {"text": "..."} inside a preflight/postflight step.
Common situations: Authors writing a single notice as a plain string instead of a one-element array; config templating that renders a scalar when the list has one item.
Related errors
- brew-cask:{}: {kind} terminate_process failure_message must
- brew-cask:{}: {kind} terminate_process name must not be empt
- brew-cask:{}: {kind} terminate_process match must be name or
- brew-cask:{}: {kind} terminate_process {field} must be a boo
- brew-cask:{}: unsupported {kind} step type {}
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/895a6e4210101183.
Report an issue: GitHub.