tauri-apps/tauri · error · io::Error

{error_message}: {e}

Error message

{error_message}: {e}

What it means

assert_command wraps the result of spawning/waiting for an external signing or notarization command (codesign, notarytool, etc.). If the process failed to run, it re-raises the io::Error prefixed with the given context message; if the process ran but exited non-zero, it returns Error::other with just the message.

Solutions

  1. Read the wrapped message after the colon to see the root cause (e.g. 'No such file or directory' means the tool binary is missing)
  2. Verify the signing identity exists: `security find-identity -v -p codesigning`
  3. Install/verify Xcode command line tools (`xcode-select --install`) and that codesign/notarytool are on PATH
  4. Check certificate env vars (APPLE_CERTIFICATE, APPLE_CERTIFICATE_PASSWORD, APPLE_ID/APPLE_PASSWORD or APPLE_API_KEY) are correct and unexpired
  5. Run the failing command manually to see full stderr

Example fix

// before: sign with a non-existent identity
sign(app_path, "Developer ID Application: Foo (BADTEAM)", ...)
// after: use a valid identity from `security find-identity`
sign(app_path, "Developer ID Application: Acme Inc (TEAMID1234)", ...)
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight checks before signing/notarizing
assert(typeof process.env.APPLE_CERTIFICATE_PASSWORD === 'string');
// verify codesigning identity exists:
// security find-identity -v -p codesigning | grep 'Developer ID Application'

Try / catch

match tauri_macos_sign::sign(&app, &identity, &cert) {
  Err(e) if e.to_string().contains("codesign") => eprintln!("Signing failed: {e}; check identity & keychain"),
  Err(e) => return Err(e.into()),
  Ok(_) => {}
}

Prevention

When it happens

Trigger: with_certificate_file, sign or notarize_inner invoke a command whose ExitStatus is an Err (binary missing, permission denied) or non-zero (codesign rejects the app, wrong certificate password, notarization rejected).

Common situations: Missing Apple developer certificate in the keychain, wrong APPLE_CERTIFICATE_PASSWORD, codesign/xcode-tools not installed, expired provisioning/signing identity, App Store Connect API keys rejected during notarization.

Understand the failure class

Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/0660491eb49ca70f. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri-macos-sign/src/lib.rs:362

  let decoded = base64::engine::general_purpose::STANDARD
    .decode(&cleaned)
    .map_err(Error::Base64Decode)?;

  std::fs::write(out_path, &decoded).map_err(|error| Error::Fs {
    context: "failed to write decoded certificate",
    path: out_path.to_path_buf(),
    error,
  })?;

  Ok(())
}

fn assert_command(
  response: std::result::Result<std::process::ExitStatus, std::io::Error>,
  error_message: &str,
) -> std::io::Result<()> {
  let status =
    response.map_err(|e| std::io::Error::new(e.kind(), format!("{error_message}: {e}")))?;
  if !status.success() {
    Err(std::io::Error::other(error_message))
  } else {
    Ok(())
  }
}

View on GitHub (pinned to 460ec35447)