{"record":{"id":"bd4dd5549405dcb5","repo":"astrid-runtime/astrid","slug":"read-capsule-projection-entry-error","errorCode":null,"errorMessage":"read capsule projection entry: {error}","messagePattern":"read capsule projection entry: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/lib.rs","lineNumber":1627,"sourceCode":"        if components[2] != digest {\n            anyhow::bail!(\"materialized capsule digest does not match durable registry\");\n        }\n        Ok(())\n    }\n\n    /// Inventory a projection without traversing redirects or special files.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    fn inventory_projection_files(root: &Path) -> anyhow::Result<ProjectionInventory> {\n        fn walk(\n            root: &Path,\n            directory: &Path,\n            inventory: &mut ProjectionInventory,\n        ) -> anyhow::Result<()> {\n            for entry in std::fs::read_dir(directory).map_err(|error| {\n                anyhow::anyhow!(\"read capsule projection {}: {error}\", directory.display())\n            })? {\n                let entry = entry\n                    .map_err(|error| anyhow::anyhow!(\"read capsule projection entry: {error}\"))?;\n                let path = entry.path();\n                let relative = path.strip_prefix(root).map_err(|_| {\n                    anyhow::anyhow!(\"capsule projection escaped its root: {}\", path.display())\n                })?;\n                let relative_text = relative.to_str().ok_or_else(|| {\n                    anyhow::anyhow!(\"capsule projection path is not UTF-8: {}\", path.display())\n                })?;\n                let metadata = std::fs::symlink_metadata(&path).map_err(|error| {\n                    anyhow::anyhow!(\"inspect capsule projection {}: {error}\", path.display())\n                })?;\n                let file_type = metadata.file_type();\n                if file_type.is_symlink() {\n                    anyhow::bail!(\n                        \"capsule projection contains a symbolic link: {}\",\n                        path.display()\n                    );\n                }\n                if file_type.is_dir() {","sourceCodeStart":1609,"sourceCodeEnd":1645,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/lib.rs#L1609-L1645","documentation":"Thrown when a `read_dir` entry itself fails to be materialized into a `DirEntry` during the projection inventory walk. This happens when the underlying readdir call fails mid-iteration for a specific entry (e.g. the file was removed between listing and stat, or an IO error occurred on that slot).","triggerScenarios":"Walking a projection directory while an entry is concurrently deleted/renamed, or the filesystem reports an IO error for a particular directory entry.","commonSituations":"Concurrent writers modifying the projection while an inventory is being built; network filesystems with flaky readdir; race between garbage collection and inventory.","solutions":["Retry the inventory walk; transient entry errors often resolve on a fresh pass.","Ensure no concurrent process mutates the projection directory during inventory.","If entry-level failures are acceptable, skip and log instead of failing the whole walk.","Check filesystem health (dmesg / fsck) if errors persist."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match walk_inventory(root) {\n    Err(e) if is_transient_entry_error(&e) => walk_inventory(root), // one retry\n    other => other,\n}","preventionTips":["Quiesce writers/GC during inventory walks.","Avoid inventories on flaky network filesystems when possible.","Treat single-entry failures as skippable-and-logged if consistency allows."],"tags":["filesystem","io","rust","concurrency"],"backgroundTag":"file-read-failed","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}