{"record":{"id":"f42f45d84de8977c","repo":"astrid-runtime/astrid","slug":"materialized-capsule-is-absent-from-durable-regist","errorCode":null,"errorMessage":"materialized capsule is absent from durable registry","messagePattern":"materialized capsule is absent from durable registry","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/capsule_materialization.rs","lineNumber":29,"sourceCode":"        &self,\n        dir: &Path,\n        principal: &astrid_core::principal::PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n        snapshot: &astrid_storage::CapsulePackageSnapshot,\n    ) -> anyhow::Result<()> {\n        self.validate_published_cache_path(dir, principal, manifest, snapshot)?;\n        let uid = self\n            .principal_directory\n            .uid_for(principal)\n            .map_err(|error| anyhow::anyhow!(\"resolve capsule cache owner UID: {error}\"))?;\n        let verified = astrid_capsule_install::read_verified_durable_package_for_owner(\n            self.principal_store\n                .as_ref()\n                .ok_or_else(|| anyhow::anyhow!(\"durable capsule registry is unavailable\"))?,\n            &astrid_storage::StateOwner::Principal(uid),\n            manifest.package.name.as_str(),\n        )?\n        .ok_or_else(|| anyhow::anyhow!(\"materialized capsule is absent from durable registry\"))?;\n        if verified.snapshot() != snapshot {\n            anyhow::bail!(\"materialized capsule snapshot differs from the caller's publication\");\n        }\n        if verified.manifest().package.name != manifest.package.name\n            || verified.manifest().package.version != manifest.package.version\n        {\n            anyhow::bail!(\"materialized capsule manifest differs from durable registry\");\n        }\n        let manifest_bytes = Self::read_projection_file_nofollow(&dir.join(\"Capsule.toml\"))\n            .map_err(|error| anyhow::anyhow!(\"read materialized capsule manifest: {error:#}\"))?;\n        if manifest_bytes != verified.manifest_bytes() {\n            anyhow::bail!(\"durable capsule manifest bytes do not match materialization\");\n        }\n        let metadata_bytes = Self::read_projection_file_nofollow(&dir.join(\"meta.json\"))\n            .map_err(|error| anyhow::anyhow!(\"read materialized capsule metadata: {error:#}\"))?;\n        if metadata_bytes != verified.metadata_bytes() {\n            anyhow::bail!(\"durable capsule metadata does not match materialization\");\n        }","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/capsule_materialization.rs#L11-L47","documentation":"The durable capsule registry was consulted for the published capsule under the owner's UID, but no record was returned. Verification expects the materialized capsule to also exist in the durable registry; its absence means the publication record is missing or was removed, so the materialization cannot be verified.","triggerScenarios":"verify_published_materialization() calls read_verified_durable_package_for_owner(...) and the Option comes back None, hitting .ok_or_else(|| anyhow!(\"materialized capsule is absent from durable registry\")).","commonSituations":"The durable registry entry was deleted (cleanup job, manual prune) while the on-disk materialization remains; the package was materialized under a different owner UID than queried; a failed publication never wrote the registry record.","solutions":["Re-publish the capsule so the durable registry record is recreated, then re-run verification","Check that the queried StateOwner::Principal(uid) matches the UID that actually owns the materialization","Restore the registry entry from backup or run the repair_published_materialization flow","Inspect registry pruning/cleanup jobs that may have removed the record"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let record = registry.read_verified_durable_package_for_owner(owner, name)?;\nif record.is_none() {\n    return Err(format!(\"capsule {name} has no durable registry record; re-publish before verifying\"));\n}","typeGuard":null,"tryCatchPattern":"match read_verified_durable_package_for_owner(&store, &owner, name)? {\n    Some(verified) => compare_and_accept(verified),\n    None => {\n        log::warn!(\"capsule {name} missing from durable registry; triggering repair\");\n        repair_flow(name)\n    }\n}","preventionTips":["Publish the durable registry record in the same transaction/step as materialization","Exclude capsule registry entries from cleanup/prune jobs, or verify before pruning","Run the repair flow automatically when registry records are found missing"],"tags":["durable-registry","record-not-found","capsules"],"backgroundTag":"record-not-found","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"}