{"record":{"id":"a3eb06e2cc5a6927","repo":"jdx/mise","slug":"invalid-system-package-spec-expected-manager","errorCode":null,"errorMessage":"invalid system package spec: expected '<manager>:<package>[@version]'","messagePattern":"invalid system package spec: expected '<manager>:<package>\\[@version\\]'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/mod.rs","lineNumber":1566,"sourceCode":"    } else {\n        name.rsplit_once('/').map(|(tap, _)| tap)\n    }\n}\n\nfn is_brew_manager(mgr: &str) -> bool {\n    matches!(mgr, \"brew\" | \"brew-cask\")\n}\n\nfn is_opaque_package_manager(mgr: &str) -> bool {\n    is_brew_manager(mgr) || mgr == \"mas\"\n}\n\nfn normalize_use_spec_package_name<'a>(mgr: &str, name: &'a str) -> eyre::Result<&'a str> {\n    if mgr == \"mas\"\n        && let Some(name) = name.strip_suffix(\"@latest\")\n    {\n        if name.is_empty() {\n            bail!(\"invalid system package spec: expected '<manager>:<package>[@version]'\");\n        }\n        return Ok(name);\n    }\n    Ok(name)\n}\n\nfn validate_package_name(mgr: &str, name: &str) -> eyre::Result<()> {\n    if mgr == \"mas\" && !packages::mas::is_adam_id(name) {\n        bail!(\"mas app IDs must be numeric ADAM IDs (e.g. \\\"mas:497799835\\\")\");\n    }\n    Ok(())\n}\n\npub(crate) fn brew_taps_from_config(config: &Config) -> IndexMap<String, String> {\n    brew_taps_from_config_files(&config.config_files)\n}\n\nfn brew_taps_from_config_files(config_files: &ConfigMap) -> IndexMap<String, String> {","sourceCodeStart":1548,"sourceCodeEnd":1584,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/mod.rs#L1548-L1584","documentation":"When normalizing `mas` (Mac App Store) use-specs, normalize_use_spec_package_name strips a '@latest' suffix from the package name. If stripping leaves an empty name (spec was effectively 'mas:@latest'), it bails because there is no actual package identifier left.","triggerScenarios":"Calling `mise bootstrap packages use mas:@latest` (or a config entry resolving to that), i.e. the mas manager with '@latest' as the version but no package name/id before it.","commonSituations":"Hand-writing a Mac App Store entry and omitting the numeric app ID or app name; templating gone wrong where the package variable was empty; misunderstanding that mas requires an app ID (e.g. mas:497799835 for Xcode).","solutions":["Supply the app ID or name: \"mas:497799835\" or \"mas:Xcode\"","Drop '@latest' — mas specs don't need it; just use \"mas:<app-id>\"","Fix templates/variables in your config that produced an empty package name"],"exampleFix":"// before\n//   mise bootstrap packages use mas:@latest\n// after\n//   mise bootstrap packages use mas:497799835","handlingStrategy":"validation","validationCode":"// For mas specs, a non-empty package id must precede any @latest suffix:\nfunction isValidMasSpec(spec: string): boolean {\n  if (!spec.startsWith(\"mas:\")) return true;\n  const name = spec.slice(4).replace(/@latest$/, \"\");\n  return name.length > 0;\n}\n// isValidMasSpec(\"mas:@latest\") === false; isValidMasSpec(\"mas:497799835\") === true","typeGuard":"function hasMasPackageName(spec: string): boolean {\n  if (!spec.startsWith(\"mas:\")) return true;\n  return spec.slice(4).replace(/@latest$/, \"\").length > 0;\n}","tryCatchPattern":"try {\n  await mise([\"bootstrap\", \"packages\", \"use\", spec]);\n} catch (e) {\n  if (String(e).includes(\"invalid system package spec\")) {\n    throw new Error(`mas needs an app id, e.g. mas:497799835 (got \"${spec}\")`);\n  }\n  throw e;\n}","preventionTips":["Always include the Mac App Store numeric id (or app name) after mas:","Drop @latest for mas entries — plain mas:<app-id> is the expected form","Check templated configs for empty variables that leave mas: with nothing after it","Verify ids via `mas search <app>` on macOS before adding them to config"],"tags":["cli","parsing","macos","system-packages"],"backgroundTag":"invalid-argument-format","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"}