{"record":{"id":"ff4c16d458861b30","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-name-must-n","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process name must not be empty","messagePattern":"brew-cask:(.+?): (.+?) terminate_process name must not be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5721,"sourceCode":"                &[\n                    \"type\",\n                    \"name\",\n                    \"match\",\n                    \"sudo\",\n                    \"attempts\",\n                    \"must_succeed\",\n                    \"notices\",\n                    \"failure_message\",\n                ],\n            )?;\n            let name = object.get(\"name\").and_then(Value::as_str).ok_or_else(|| {\n                eyre!(\n                    \"brew-cask:{}: {kind} terminate_process name must be a string\",\n                    cask.token\n                )\n            })?;\n            if name.is_empty() {\n                bail!(\n                    \"brew-cask:{}: {kind} terminate_process name must not be empty\",\n                    cask.token\n                );\n            }\n            let match_mode = match object.get(\"match\") {\n                None => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"name\" => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"full\" => ProcessMatch::Full,\n                _ => bail!(\n                    \"brew-cask:{}: {kind} terminate_process match must be name or full\",\n                    cask.token\n                ),\n            };\n            let sudo = parse_optional_flight_bool(cask, kind, object, \"sudo\", false)?;\n            let must_succeed =\n                parse_optional_flight_bool(cask, kind, object, \"must_succeed\", false)?;\n            let attempts = match object.get(\"attempts\") {\n                None => 1,","sourceCodeStart":5703,"sourceCodeEnd":5739,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5703-L5739","documentation":"Thrown while parsing a terminate_process step inside preflight_steps/postflight_steps. The step's 'name' field was found and is a string, but it is empty — there is no process name to match against, so the step could never fire and is rejected at parse time rather than becoming a silent no-op.","triggerScenarios":"{\"type\": \"terminate_process\", \"name\": \"\"} inside any step of a preflight_steps or postflight_steps group; the cask token and kind (preflight_steps/postflight_steps) are interpolated into the message.","commonSituations":"Templated cask JSON where the process-name variable was empty; placeholders left in hand-written steps; refactors that moved the process name into 'match' by mistake.","solutions":["Set name to the real process name to match, e.g. \"name\": \"myapp-helper\"","Use \"match\": \"full\" with the full executable path in name if a bare name is ambiguous","If the step is not needed, delete the whole terminate_process step object"],"exampleFix":"// before\n{\"type\": \"terminate_process\", \"name\": \"\"}\n// after\n{\"type\": \"terminate_process\", \"name\": \"zoom.us\", \"match\": \"name\"}","handlingStrategy":"validation","validationCode":"fn terminate_process_steps_ok(v: &serde_json::Value) -> bool {\n    let Some(groups) = v.as_object().and_then(|o| {\n        o.get(\"preflight_steps\").or_else(|| o.get(\"postflight_steps\"))\n    }).and_then(|g| g.as_array()) else { return true; };\n    groups.iter().all(|g| g.get(\"steps\").and_then(|s| s.as_array()).map(|steps| {\n        steps.iter().all(|s| {\n            s.get(\"type\").and_then(|t| t.as_str()) != Some(\"terminate_process\")\n                || s.get(\"name\").and_then(|n| n.as_str()).map(|n| !n.is_empty()).unwrap_or(false)\n        })\n    }).unwrap_or(true))\n}","typeGuard":null,"tryCatchPattern":"match parse_flight_step(&cask, kind, &step) {\n    Ok(step) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"terminate_process name must not be empty\") => {\n        eprintln!(\"cask {token}: terminate_process step needs a real process name\", token = cask.token);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Fill process names from variables with a non-empty guard, or skip emitting the step","Verify names against `ps aux` / Activity Monitor before shipping the cask"],"tags":["brew-cask","mise","terminate-process","flight-steps","config-validation"],"backgroundTag":"brew-cask-stanza-validation","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}