{"record":{"id":"903eb4f1b57146a8","repo":"jdx/mise","slug":"mas-list-failed","errorCode":null,"errorMessage":"mas list failed: {}","messagePattern":"mas list failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/mas.rs","lineNumber":211,"sourceCode":"                Some(err.to_string())\n            }\n        }\n    } else {\n        None\n    };\n\n    debug!(\"$ mas list\");\n    let text_output = tokio::process::Command::new(mas)\n        .arg(\"list\")\n        .stdin(Stdio::null())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped())\n        .output()\n        .await?;\n    if !text_output.status.success() {\n        let json_stderr = String::from_utf8_lossy(&json_output.stderr);\n        let text_stderr = String::from_utf8_lossy(&text_output.stderr);\n        bail!(\n            \"mas list failed: {}\",\n            if text_stderr.trim().is_empty() {\n                json_err.as_deref().unwrap_or_else(|| json_stderr.trim())\n            } else {\n                text_stderr.trim()\n            }\n        );\n    }\n    let stdout = String::from_utf8_lossy(&text_output.stdout);\n    Ok(parse_mas_text(&stdout))\n}\n\n#[async_trait(?Send)]\nimpl SystemPackageManager for MasManager {\n    fn name(&self) -> &str {\n        \"mas\"\n    }\n","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/mas.rs#L193-L229","documentation":"mas_list runs both `mas list --json` and a text-mode `mas list`; if the text invocation exits non-zero, the backend wraps the failure with this prefix. It prefers the text-mode stderr, falling back to the JSON run's captured error/stderr when the text stderr is empty, so the message carries mas's own diagnostic.","triggerScenarios":"Calling installed() on the mas backend when either `mas list` invocation exits with a non-zero status — e.g. mas not signed in to the App Store, network failure, or a missing/broken mas binary.","commonSituations":"Running `mas list` before ever signing into the Mac App Store (`mas account` shows not signed in); offline machine; App Store session expired.","solutions":["Read the detail after the prefix: it contains mas's own stderr (e.g. authentication error) and fix that underlying cause.","Sign in to the Mac App Store (System Settings → sign in, or `mas signin` on mas versions that support it) and retry.","Verify network connectivity to Apple's App Store servers and that `mas list` works manually in a shell."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let status = Command::new(\"mas\").arg(\"account\").output()?;\nif !status.status.success() || String::from_utf8_lossy(&status.stdout).contains(\"not signed in\") { /* prompt sign-in before listing */ }","typeGuard":null,"tryCatchPattern":"match backend.installed(&pkgs, &opts).await {\n    Ok(apps) => apps,\n    Err(e) if e.to_string().starts_with(\"mas list failed:\") => { eprintln!(\"{}\", e); /* check sign-in/network then retry */ Vec::new() }\n    Err(e) => return Err(e),\n}","preventionTips":["Ensure the Mac App Store is signed in before automated mas calls.","Check network reachability to Apple before batch queries.","Verify `mas list` works interactively in CI before running automation."],"tags":["mas","subprocess","app-store","command-failed"],"backgroundTag":"command-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}