{"record":{"id":"8d573e7d8b56459d","repo":"tauri-apps/tauri","slug":"failed-to-get-bundle-filename","errorCode":null,"errorMessage":"failed to get bundle filename","messagePattern":"failed to get bundle filename","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-macos-sign/src/lib.rs","lineNumber":145,"sourceCode":"}\n\npub fn notarize_without_stapling(\n  keychain: &Keychain,\n  app_bundle_path: &Path,\n  auth: &AppleNotarizationCredentials,\n) -> Result<()> {\n  notarize_inner(keychain, app_bundle_path, auth, false)\n}\n\nfn notarize_inner(\n  keychain: &Keychain,\n  app_bundle_path: &Path,\n  auth: &AppleNotarizationCredentials,\n  wait: bool,\n) -> Result<()> {\n  let bundle_stem = app_bundle_path\n    .file_stem()\n    .expect(\"failed to get bundle filename\");\n\n  let tmp_dir = tempfile::tempdir().map_err(Error::TempDir)?;\n  let zip_path = tmp_dir\n    .path()\n    .join(format!(\"{}.zip\", bundle_stem.to_string_lossy()));\n  let zip_args = vec![\n    \"-c\",\n    \"-k\",\n    \"--keepParent\",\n    \"--sequesterRsrc\",\n    app_bundle_path\n      .to_str()\n      .expect(\"failed to convert bundle_path to string\"),\n    zip_path\n      .to_str()\n      .expect(\"failed to convert zip_path to string\"),\n  ];\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-macos-sign/src/lib.rs#L127-L163","documentation":"This panic occurs in notarize_inner when app_bundle_path.file_stem() returns None, meaning the path has no file stem (e.g. it is '/', '..', or an empty/root path). The library expects a real .app bundle path to zip and submit to Apple's notarytool, and panics instead of returning an error because a valid bundle must always have a filename.","triggerScenarios":"Calling tauri_plugin_macos_sign's notarize or notarize_without_stapling with an app_bundle_path that is a root path, empty, or otherwise lacks a final component with a stem.","commonSituations":"A build script resolved the .app bundle path incorrectly (e.g. env var not set, glob matched nothing and fell back to a directory root), or a CI variable interpolated to an empty string leaving the path as '/' or '.','.","solutions":["Verify the app_bundle_path passed to notarize points to an actual Foo.app directory before calling","Check that any env var or config value supplying the bundle path is non-empty and resolves to a real path","Use std::fs::metadata to confirm the bundle exists and is a directory","Log the path immediately before the notarize call to catch misresolution early"],"exampleFix":"// before\nnotarize(\"/\", &auth, true).unwrap();\n// after\nlet bundle = std::path::Path::new(\"./target/release/bundle/macos/myapp.app\");\nassert!(bundle.is_dir(), \"bundle path missing\");\nnotarize(bundle, &auth, true).unwrap();","handlingStrategy":"validation","validationCode":"let bundle = Path::new(\"target/release/bundle/macos/myapp.app\");\nif bundle.file_stem().is_none() || !bundle.is_dir() {\n    panic!(\"invalid app bundle path: {}\", bundle.display());\n}\nnotarize(bundle, &auth, true)?;","typeGuard":"fn has_stem(p: &Path) -> bool { p.file_stem().is_some() }","tryCatchPattern":null,"preventionTips":["Always resolve the .app bundle path with fs::metadata before notarizing","Avoid passing env-var-derived paths without an existence check","Use canonicalize() to surface empty/root paths early"],"tags":["macos","notarization","path-handling","panic"],"backgroundTag":"invalid-argument-value","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}