{"record":{"id":"cd80c6f832e85c40","repo":"tauri-apps/tauri","slug":"can-t-read-source-directory","errorCode":null,"errorMessage":"Can't read source directory","messagePattern":"Can't read source directory","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/updater_bundle.rs","lineNumber":259,"sourceCode":"  Ok(dest_path.to_owned())\n}\n\n#[cfg(target_os = \"macos\")]\nfn create_tar_from_src<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> crate::Result<W> {\n  let src_dir = src_dir.as_ref();\n  let mut builder = tar::Builder::new(dest_file);\n  builder.follow_symlinks(false);\n  builder.append_dir_all(src_dir.file_name().expect(\"Path has no file_name\"), src_dir)?;\n  builder.into_inner().map_err(Into::into)\n}\n\n#[cfg(target_os = \"linux\")]\nfn create_tar_from_src<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> crate::Result<W> {\n  let src_dir = src_dir.as_ref();\n  let mut tar_builder = tar::Builder::new(dest_file);\n\n  // validate source type\n  let file_type = fs::metadata(src_dir).expect(\"Can't read source directory\");\n  // if it's a file don't need to walkdir\n  if file_type.is_file() {\n    let mut src_file = fs::File::open(src_dir)?;\n    let file_name = src_dir\n      .file_name()\n      .expect(\"Can't extract file name from path\");\n\n    tar_builder.append_file(file_name, &mut src_file)?;\n  } else {\n    for entry in walkdir::WalkDir::new(src_dir) {\n      let entry = entry?;\n      let src_path = entry.path();\n      if src_path == src_dir {\n        continue;\n      }\n\n      // We add the .parent() because example if we send a path\n      // /dev/src-tauri/target/debug/bundle/osx/app.app","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/updater_bundle.rs#L241-L277","documentation":"On Linux, create_tar_from_src stats the updater bundle source (the bundle content being archived) before deciding whether to walk it as a directory. fs::metadata fails when that path does not exist or is not readable, so the expect fires when the expected bundle artifact is missing at updater-archive time.","triggerScenarios":"tauri build with createUpdaterArtifacts enabled when the AppImage/bundle source was never produced (an earlier bundle step failed or was skipped) or was deleted before the updater step ran (concurrent cargo clean, antivirus, out-of-disk).","commonSituations":"Concurrent cargo clean or CI cache restoration that partially repopulates target/; earlier bundling steps failing in custom scripts; disk-full dropping artifacts; antivirus quarantine on Windows-dominated setups.","solutions":["Re-run the full tauri build so all bundle steps execute in order on a clean target","Check the logs above for an earlier AppImage/deb step failure that left the source missing","Stop concurrent cleaners and free disk space, then retry","Verify the logged source path exists immediately before the updater step in a verbose run"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# preflight for updater bundles: the source artifact must exist\nBUNDLE_SRC=\"target/release/bundle/appimage/myapp_amd64.AppDir\"\ntest -e \"$BUNDLE_SRC\" || { echo \"updater source missing — rerun tauri build\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run cargo clean or prune target/ concurrently with bundling","Treat CI caches of target/bundle as all-or-nothing; a partially restored cache breaks the updater step","Check that the AppImage/deb step succeeded before enabling createUpdaterArtifacts in pipelines"],"tags":["updater","linux","tar","missing-file","tauri-bundler"],"backgroundTag":"file-not-found","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}