{"record":{"id":"bac2be129a3b3fc7","repo":"jdx/mise","slug":"mas-list-json-returned-no-parseable-app-objects","errorCode":null,"errorMessage":"mas list --json returned no parseable app objects","messagePattern":"mas list --json returned no parseable app objects","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/mas.rs","lineNumber":101,"sourceCode":"            \"versionString\",\n        ],\n    )?;\n    Some(InstalledApp {\n        adam_id,\n        bundle_id,\n        version,\n    })\n}\n\nfn parse_mas_json(output: &str) -> EyreResult<Vec<InstalledApp>> {\n    let output = output.trim();\n    if output.is_empty() {\n        return Ok(vec![]);\n    }\n    if let Ok(Value::Array(values)) = serde_json::from_str::<Value>(output) {\n        let apps: Vec<_> = values.iter().filter_map(parse_mas_json_value).collect();\n        if apps.is_empty() && !values.is_empty() {\n            bail!(\"mas list --json returned no parseable app objects\");\n        }\n        return Ok(apps);\n    }\n    let mut apps = vec![];\n    for line in output\n        .lines()\n        .map(str::trim)\n        .filter(|line| !line.is_empty())\n    {\n        let value = serde_json::from_str::<Value>(line)\n            .map_err(|err| eyre!(\"mas list --json returned invalid JSON: {err}\"))?;\n        match parse_mas_json_value(&value) {\n            Some(app) => apps.push(app),\n            None => bail!(\"mas list --json returned an app object without an ID and version\"),\n        }\n    }\n    Ok(apps)\n}","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/mas.rs#L83-L119","documentation":"Parse consistency check in parse_mas_json: `mas list --json` returned a non-empty JSON array but none of its objects could be parsed into an InstalledApp (missing adam_id/bundle_id/versionString fields), suggesting an unexpected mas output schema version rather than an empty list.","triggerScenarios":"Thrown at src/system/packages/mas.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `mas list --json` manually and inspect the object schema","Update the parser to the fields emitted by the installed mas version","Ensure mas is up to date (`mas self-update` or brew upgrade mas)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}