{"record":{"id":"44ebfdff79d71093","repo":"tauri-apps/tauri","slug":"failed-to-convert-apple-provider-short-name-to-str","errorCode":null,"errorMessage":"failed to convert APPLE_PROVIDER_SHORT_NAME to string","messagePattern":"failed to convert APPLE_PROVIDER_SHORT_NAME to string","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/interface/rust.rs","lineNumber":1461,"sourceCode":"      resources.push(path.display().to_string());\n    }\n  }\n\n  let signing_identity = match std::env::var_os(\"APPLE_SIGNING_IDENTITY\") {\n    Some(signing_identity) => Some(\n      signing_identity\n        .to_str()\n        .expect(\"failed to convert APPLE_SIGNING_IDENTITY to string\")\n        .to_string(),\n    ),\n    None => config.macos.signing_identity,\n  };\n\n  let provider_short_name = match std::env::var_os(\"APPLE_PROVIDER_SHORT_NAME\") {\n    Some(provider_short_name) => Some(\n      provider_short_name\n        .to_str()\n        .expect(\"failed to convert APPLE_PROVIDER_SHORT_NAME to string\")\n        .to_string(),\n    ),\n    None => config.macos.provider_short_name,\n  };\n\n  let (resources, resources_map) = match resources {\n    BundleResources::List(paths) => (Some(paths), None),\n    BundleResources::Map(map) => (None, Some(map)),\n  };\n\n  #[cfg(target_os = \"macos\")]\n  let entitlements = if let Some(plugin_config) = tauri_config\n    .plugins\n    .0\n    .get(\"deep-link\")\n    .and_then(|c| c.get(\"desktop\").cloned())\n  {\n    let protocols: DesktopDeepLinks =","sourceCodeStart":1443,"sourceCodeEnd":1479,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/interface/rust.rs#L1443-L1479","documentation":"When bundling for macOS/App Store uploads, the CLI overrides the config's provider short name with the APPLE_PROVIDER_SHORT_NAME environment variable. to_str() returns None when the variable holds non-UTF-8 bytes, and this expect panics. As with the signing identity, only the encoding of the env var matters, not the value.","triggerScenarios":"Running `tauri build` (App Store connect flows) with APPLE_PROVIDER_SHORT_NAME exported containing raw non-UTF-8 bytes from a mis-encoded script, secret, or locale-mangled shell profile.","commonSituations":"CI providers writing secrets with bad encodings; team names copied from web pages with smart quotes or non-breaking spaces in a non-UTF-8 terminal.","solutions":["Check the raw bytes: `env | grep APPLE_PROVIDER_SHORT_NAME | xxd | head`.","Re-export as clean ASCII: `export APPLE_PROVIDER_SHORT_NAME=\"MyTeam\"`.","Re-create the CI secret from plain text.","Confirm the correct value in App Store Connect (Users and Access > keys/providers) before re-adding it."],"exampleFix":"# before\nexport APPLE_PROVIDER_SHORT_NAME=$'Bad\\xffName'\n\n# after\nexport APPLE_PROVIDER_SHORT_NAME=\"MyTeamName\"","handlingStrategy":"validation","validationCode":"# Reject non-UTF-8 before building\npython3 - <<'EOF'\nimport os, sys\nv = os.environb.get(b'APPLE_PROVIDER_SHORT_NAME')\nif v is not None:\n    try: v.decode('utf-8')\n    except UnicodeDecodeError:\n        sys.exit('APPLE_PROVIDER_SHORT_NAME is not valid UTF-8')\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep App Store provider names as simple ASCII strings in secrets.","Re-create (not edit) CI secrets when they were pasted from rich text sources.","Validate all APPLE_* env vars decode as UTF-8 in a CI preflight step."],"tags":["macos","app-store","environment","utf-8","tauri-cli"],"backgroundTag":"invalid-utf8-env-var","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","contentChangedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}