tauri-apps/tauri · error

Can't read source directory

Error message

Can't read source directory

What it means

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.

Source

Thrown at crates/tauri-bundler/src/bundle/updater_bundle.rs:259

  Ok(dest_path.to_owned())
}

#[cfg(target_os = "macos")]
fn create_tar_from_src<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> crate::Result<W> {
  let src_dir = src_dir.as_ref();
  let mut builder = tar::Builder::new(dest_file);
  builder.follow_symlinks(false);
  builder.append_dir_all(src_dir.file_name().expect("Path has no file_name"), src_dir)?;
  builder.into_inner().map_err(Into::into)
}

#[cfg(target_os = "linux")]
fn create_tar_from_src<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> crate::Result<W> {
  let src_dir = src_dir.as_ref();
  let mut tar_builder = tar::Builder::new(dest_file);

  // validate source type
  let file_type = fs::metadata(src_dir).expect("Can't read source directory");
  // if it's a file don't need to walkdir
  if file_type.is_file() {
    let mut src_file = fs::File::open(src_dir)?;
    let file_name = src_dir
      .file_name()
      .expect("Can't extract file name from path");

    tar_builder.append_file(file_name, &mut src_file)?;
  } else {
    for entry in walkdir::WalkDir::new(src_dir) {
      let entry = entry?;
      let src_path = entry.path();
      if src_path == src_dir {
        continue;
      }

      // We add the .parent() because example if we send a path
      // /dev/src-tauri/target/debug/bundle/osx/app.app

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Re-run the full tauri build so all bundle steps execute in order on a clean target
  2. Check the logs above for an earlier AppImage/deb step failure that left the source missing
  3. Stop concurrent cleaners and free disk space, then retry
  4. Verify the logged source path exists immediately before the updater step in a verbose run
Defensive patterns

Strategy: validation

Validate before calling

# preflight for updater bundles: the source artifact must exist
BUNDLE_SRC="target/release/bundle/appimage/myapp_amd64.AppDir"
test -e "$BUNDLE_SRC" || { echo "updater source missing — rerun tauri build"; exit 1; }

Prevention

When it happens

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

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20). Data as JSON: /api/errors/cd80c6f832e85c40. Report an issue: GitHub.