{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/mas.rs#L193-L229","documentation":"mas_list runs `mas list` (text and JSON passes) and bails when the mas subprocess exits non-zero, reporting the most informative stderr: the text-mode stderr if non-empty, otherwise the JSON-mode stderr. It aggregates the failure of either invocation into one error.","triggerScenarios":"The `mas list` subprocess returns a non-zero exit status — e.g. mas not signed in to the Mac App Store, App Store daemon unavailable, or mas binary failing to launch its JSON or text listing pass.","commonSituations":"Running mise on a fresh macOS box before `mas account` sign-in; App Store servers unreachable; corporate network blocking Apple endpoints; mas CLI crashed due to an outdated macOS version.","solutions":["Run `mas list` in a terminal to see the underlying error directly","Sign in to the Mac App Store (`mas signin` or the App Store app) — a missing session is the most common cause","Ensure macOS is up to date; old mas releases fail against newer App Store daemons","Check network connectivity to Apple App Store endpoints"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"mas account 2>&1 || echo \"not signed in to Mac App Store\"","typeGuard":null,"tryCatchPattern":"match mas_list(bin).await {\n    Ok(apps) => apps,\n    Err(e) if e.to_string().contains(\"mas list failed\") => {\n        eprintln!(\"App Store unavailable or not signed in: {e}\");\n        Vec::new()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Sign in to the Mac App Store before running package syncs","Check `mas account` in CI/automation before invoking mas-dependent providers","Keep macOS and mas current; stale mas builds fail against new daemons"],"tags":["macos","mas","subprocess","package-manager"],"backgroundTag":"command-failed","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"}