{"record":{"id":"a9ab6dc8829e34e6","repo":"astrid-runtime/astrid","slug":"durable-capsule-archive-contains-an-unsupported-en","errorCode":null,"errorMessage":"durable capsule archive contains an unsupported entry","messagePattern":"durable capsule archive contains an unsupported entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/storage.rs","lineNumber":588,"sourceCode":"        if !names.insert(relative.clone()) {\n            bail!(\"durable capsule archive contains duplicate path\");\n        }\n        let output = destination.join(&relative);\n        if entry.header().entry_type().is_symlink()\n            || entry.header().entry_type().is_hard_link()\n            || entry.header().entry_type().is_block_special()\n            || entry.header().entry_type().is_character_special()\n            || entry.header().entry_type().is_fifo()\n        {\n            bail!(\"durable capsule archive contains a link or special file\");\n        }\n        if entry.header().entry_type().is_dir() {\n            fs::create_dir_all(&output)\n                .with_context(|| format!(\"create materialized directory {}\", output.display()))?;\n            continue;\n        }\n        if !entry.header().entry_type().is_file() {\n            bail!(\"durable capsule archive contains an unsupported entry\");\n        }\n        if let Some(parent) = output.parent() {\n            fs::create_dir_all(parent)\n                .with_context(|| format!(\"create materialized parent {}\", parent.display()))?;\n            reject_symlink_ancestors(destination, parent)?;\n        }\n        let mut bytes = Vec::new();\n        entry\n            .read_to_end(&mut bytes)\n            .context(\"read durable capsule archive file\")?;\n        fs::write(&output, bytes)\n            .with_context(|| format!(\"write materialized file {}\", output.display()))?;\n    }\n    fs::write(destination.join(\"meta.json\"), &package.metadata)\n        .context(\"write materialized capsule metadata\")?;\n    fs::write(destination.join(\"authority.json\"), &package.authority)\n        .context(\"write materialized capsule authority\")?;\n    Ok(())","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/storage.rs#L570-L606","documentation":"After allowing directories and regular files, any remaining tar entry type (e.g. GNU sparse, contiguous, or other exotic entry types) is rejected with this error. The materializer only implements safe handling for plain files and directories, so anything else aborts extraction.","triggerScenarios":"Materializing an archive with a non-file, non-dir entry type that is also not a link/special file — e.g. GNU long-name/sparse metadata entries created by an unusual tar implementation, or a corrupted header whose type flag is invalid.","commonSituations":"Archives produced by non-GNU or exotic tar variants; archives transferred through something that mangled headers; a partially rewritten/tampered archive with a garbage typeflag byte.","solutions":["Rebuild the archive using the library's canonical_capsule_archive so only standard file/dir entries exist.","Re-create the tar with standard settings (no --sparse, no unusual formats) if packing manually.","Verify the archive with artifact::verify_archive_bytes to detect corruption before materializing."],"exampleFix":"// before\ntar --sparse -cvf capsule.tar components\n// after\nrm capsule.tar && tar -cvf capsule.tar components","handlingStrategy":"try-catch","validationCode":"for entry in tar::Archive::new(&bytes[..]).entries()? {\n    let t = entry?.header().entry_type();\n    if !(t.is_file() || t.is_dir()) {\n        anyhow::bail!(\"unsupported entry type {:?} — rebuild archive\", t);\n    }\n}","typeGuard":null,"tryCatchPattern":"match materialize_capsule_package(&pkg, &dest) {\n    Err(e) if e.to_string().contains(\"unsupported entry\") => {\n        warn!(\"archive used exotic tar entry types; rebuilding canonically\");\n        rebuild_canonical_archive(&src_dir)?;\n        materialize_capsule_package(&pkg, &dest)?;\n    }\n    other => other,\n}","preventionTips":["Pack with standard tar settings (no --sparse, no exotic formats) or use canonical_capsule_archive.","Run artifact::verify_archive_bytes to catch header corruption before extraction.","Re-download archives if transfer may have mangled bytes."],"tags":["archive","unsupported-format","capsule"],"backgroundTag":"unsupported-operation","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"}