tauri-apps/tauri · error

No data in parent

Error message

No data in parent

What it means

create_zip creates the parent directory of the updater archive before writing it. parent() returns None only when the destination path is a filesystem root, so this expect is a near-unreachable invariant on the computed updater-artifact output path.

Source

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

          }
          p.push(c);
          (p, b)
        });
    let archived_path = archived_path.with_extension(format!("{bundle_name}.zip"));

    log::info!(action = "Bundling"; "{}", display_path(&archived_path));

    // Create our gzip file
    create_zip(&source_path, &archived_path).with_context(|| "Failed to zip update bundle")?;

    installers_archived_paths.push(archived_path);
  }

  Ok(installers_archived_paths)
}

pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
  let parent_dir = dst_file.parent().expect("No data in parent");
  fs::create_dir_all(parent_dir)?;
  let writer = fs_utils::create_file(dst_file)?;

  let file_name = src_file
    .file_name()
    .expect("Can't extract file name from path");

  let mut zip = zip::ZipWriter::new(writer);
  let options = SimpleFileOptions::default()
    .compression_method(zip::CompressionMethod::Stored)
    .unix_permissions(0o755);

  zip.start_file(file_name.to_string_lossy(), options)?;
  let mut f =
    File::open(src_file).fs_context("failed to open updater ZIP file", src_file.to_path_buf())?;

  let mut buffer = Vec::new();
  f.read_to_end(&mut buffer)?;

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Re-run tauri build without custom output-path overrides or symlinks over target/
  2. Inspect the logged 'Bundling <path>' line and ensure the updater archive path has a real parent directory
  3. Report upstream with the full config if it reproduces on a stock layout
Defensive patterns

Strategy: validation

Validate before calling

// keep updater artifact destinations on a normal nested path
if let Some(parent) = archive_dst.parent() {
  std::fs::create_dir_all(parent)?;
} else {
  anyhow::bail!("updater archive destination has no parent directory: {}", archive_dst.display());
}

Prevention

When it happens

Trigger: Bundling with updater artifacts (createUpdaterArtifacts) where the computed archive destination resolves to '/' — e.g. custom build tooling that rewrites or relocates bundle output paths to a root. Not produced by normal runs.

Common situations: Custom pipelines that override or symlink the target/bundle output layout; pathological out-dir configuration; otherwise effectively unreachable.

Related errors


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