jdx/mise · error

mas list failed

Error message

mas list failed: {}

What it means

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.

Solutions

  1. Read the detail after the prefix: it contains mas's own stderr (e.g. authentication error) and fix that underlying cause.
  2. Sign in to the Mac App Store (System Settings → sign in, or `mas signin` on mas versions that support it) and retry.
  3. Verify network connectivity to Apple's App Store servers and that `mas list` works manually in a shell.
Defensive patterns

Strategy: try-catch

Validate before calling

let status = Command::new("mas").arg("account").output()?;
if !status.status.success() || String::from_utf8_lossy(&status.stdout).contains("not signed in") { /* prompt sign-in before listing */ }

Try / catch

match backend.installed(&pkgs, &opts).await {
    Ok(apps) => apps,
    Err(e) if e.to_string().starts_with("mas list failed:") => { eprintln!("{}", e); /* check sign-in/network then retry */ Vec::new() }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: Running `mas list` before ever signing into the Mac App Store (`mas account` shows not signed in); offline machine; App Store session expired.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/903eb4f1b57146a8. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/mas.rs:211

                Some(err.to_string())
            }
        }
    } else {
        None
    };

    debug!("$ mas list");
    let text_output = tokio::process::Command::new(mas)
        .arg("list")
        .stdin(Stdio::null())
        .stdout(Stdio::piped())
        .stderr(Stdio::piped())
        .output()
        .await?;
    if !text_output.status.success() {
        let json_stderr = String::from_utf8_lossy(&json_output.stderr);
        let text_stderr = String::from_utf8_lossy(&text_output.stderr);
        bail!(
            "mas list failed: {}",
            if text_stderr.trim().is_empty() {
                json_err.as_deref().unwrap_or_else(|| json_stderr.trim())
            } else {
                text_stderr.trim()
            }
        );
    }
    let stdout = String::from_utf8_lossy(&text_output.stdout);
    Ok(parse_mas_text(&stdout))
}

#[async_trait(?Send)]
impl SystemPackageManager for MasManager {
    fn name(&self) -> &str {
        "mas"
    }

View on GitHub (pinned to 533346cc37)