{"record":{"id":"9969cba7123cdb63","repo":"astrid-runtime/astrid","slug":"capsule-archive-contains-an-empty-path","errorCode":null,"errorMessage":"capsule archive contains an empty path","messagePattern":"capsule archive contains an empty path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/artifact.rs","lineNumber":302,"sourceCode":"\nfn normalized_entry_path<R: Read>(entry: &tar::Entry<'_, R>) -> anyhow::Result<String> {\n    let path = entry.path().context(\"invalid capsule archive path\")?;\n    let mut parts = Vec::new();\n    for component in path.components() {\n        match component {\n            Component::Normal(part) => parts.push(\n                part.to_str()\n                    .context(\"capsule archive paths must be UTF-8\")?\n                    .to_string(),\n            ),\n            Component::CurDir => {},\n            Component::ParentDir | Component::RootDir | Component::Prefix(_) => {\n                bail!(\"unsafe capsule archive path '{}'\", path.display());\n            },\n        }\n    }\n    if parts.is_empty() {\n        bail!(\"capsule archive contains an empty path\");\n    }\n    Ok(parts.join(\"/\"))\n}\n\nfn hash_reader(path: String, size: u64, reader: &mut impl Read) -> anyhow::Result<ContentRecord> {\n    let mut hasher = blake3::Hasher::new();\n    let mut read = 0_u64;\n    let mut buffer = [0_u8; 16 * 1024];\n    loop {\n        let count = reader.read(&mut buffer)?;\n        if count == 0 {\n            break;\n        }\n        hasher.update(&buffer[..count]);\n        read = read.saturating_add(count as u64);\n    }\n    if read != size {\n        bail!(\"capsule entry '{path}' size changed while hashing\");","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/artifact.rs#L284-L320","documentation":"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.","triggerScenarios":"Thrown at crates/astrid-build/src/artifact.rs:302 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repack the capsule so every entry has a real relative file name","Remove zero-length/`.` path entries from the tar before distribution","Rebuild the capsule from source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}