{"record":{"id":"6654f023595a681b","repo":"jdx/mise","slug":"err-mas","errorCode":null,"errorMessage":"{err:#}","messagePattern":"\\{err:#\\}","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/system/packages/mas.rs","lineNumber":243,"sourceCode":"impl SystemPackageManager for MasManager {\n    fn name(&self) -> &str {\n        \"mas\"\n    }\n\n    fn is_available(&self) -> bool {\n        cfg!(target_os = \"macos\") && crate::file::which_non_pristine(\"mas\").is_some()\n    }\n\n    fn unavailable_reason(&self) -> String {\n        if cfg!(target_os = \"macos\") {\n            \"mas not found\".to_string()\n        } else {\n            \"only available on macos\".to_string()\n        }\n    }\n\n    async fn unavailable_reason_async(&self) -> Option<String> {\n        self.bin().await.err().map(|err| format!(\"{err:#}\"))\n    }\n\n    fn supports_version_pins(&self) -> bool {\n        false\n    }\n\n    async fn installed(&self, pkgs: &[PackageRequest]) -> Result<Vec<PackageStatus>> {\n        let apps = mas_list(self.bin().await?).await?;\n        Ok(statuses_from_apps(&apps, pkgs))\n    }\n\n    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n            bail!(\"mas cannot install a pinned version ('{p}')\");\n        }\n        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {\n            bail!(\"mas install requires a numeric ADAM ID ('{p}'); use `mas search` to find it\");\n        }","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/mas.rs#L225-L261","documentation":"Mas (Mac App Store) backend's unavailable_reason_async in src/system/packages/mas.rs maps an error from self.bin().await into a human-readable unavailable reason via format!(\"{err:#}\"), preserving the full cause chain. The package is reported unavailable (rather than erroring the whole operation) when the mas CLI cannot be located/executed.","triggerScenarios":"Resolving mas-managed packages on a system where the `mas` binary lookup fails — mas not installed, not on PATH, or running on non-macOS where mas cannot work.","commonSituations":"A mise.toml referencing `mas`-sourced apps is used on Linux or in CI without mas installed; or mas exists but is broken/incompatible with the macOS version.","solutions":["Install the mas CLI (e.g. `brew install mas`) so the binary lookup succeeds.","If on non-macOS, remove mas package entries from the config or gate them to macOS environments.","Verify mas is on PATH for the environment running mise (`which mas`)."],"exampleFix":"# before (CI on linux)\n[pkg]\nmas = { \"Xcode\" = \"497799835\" }\n# after: only on macOS hosts\n[pkg.mas]\n\"Xcode\" = \"497799835\"  # ensure `brew install mas` on macOS runners","handlingStrategy":"validation","validationCode":"# verify mas is usable before resolving mas packages\ncommand -v mas >/dev/null 2>&1 || { echo \"mas CLI not installed; skip mas packages\"; exit 0; }","typeGuard":null,"tryCatchPattern":"match backend.unavailable_reason().await {\n    Some(reason) => eprintln!(\"skipping mas package: {reason}\"),\n    None => proceed_with_install(),\n}","preventionTips":["Install mas (`brew install mas`) on all macOS machines using the config.","Gate mas package entries to macOS hosts in CI matrices.","Check mas is on PATH for non-interactive shells (mise exec contexts)."],"tags":["mas","macos","binary-lookup","package-manager"],"backgroundTag":"command-not-found","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"}