astrid-runtime/astrid · error

capsule archive contains an empty path

Error message

capsule archive contains an empty path

What it means

Fired by normalized_entry_path when all path components of a tar entry are filtered out (e.g. `.` or `./`), leaving an empty normalized path. Such an entry has no meaningful location in the capsule content tree.

Solutions

  1. Repack the capsule so every entry has a real relative file name
  2. Remove zero-length/`.` path entries from the tar before distribution
  3. Rebuild the capsule from source
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/artifact.rs:302 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/9969cba7123cdb63. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-build/src/artifact.rs:302

fn normalized_entry_path<R: Read>(entry: &tar::Entry<'_, R>) -> anyhow::Result<String> {
    let path = entry.path().context("invalid capsule archive path")?;
    let mut parts = Vec::new();
    for component in path.components() {
        match component {
            Component::Normal(part) => parts.push(
                part.to_str()
                    .context("capsule archive paths must be UTF-8")?
                    .to_string(),
            ),
            Component::CurDir => {},
            Component::ParentDir | Component::RootDir | Component::Prefix(_) => {
                bail!("unsafe capsule archive path '{}'", path.display());
            },
        }
    }
    if parts.is_empty() {
        bail!("capsule archive contains an empty path");
    }
    Ok(parts.join("/"))
}

fn hash_reader(path: String, size: u64, reader: &mut impl Read) -> anyhow::Result<ContentRecord> {
    let mut hasher = blake3::Hasher::new();
    let mut read = 0_u64;
    let mut buffer = [0_u8; 16 * 1024];
    loop {
        let count = reader.read(&mut buffer)?;
        if count == 0 {
            break;
        }
        hasher.update(&buffer[..count]);
        read = read.saturating_add(count as u64);
    }
    if read != size {
        bail!("capsule entry '{path}' size changed while hashing");

View on GitHub (pinned to affd8760f4)