{"record":{"id":"ce58b26d9dfd68fc","repo":"astrid-runtime/astrid","slug":"read-durable-capsule-registry-error","errorCode":null,"errorMessage":"read durable capsule registry: {error}","messagePattern":"read durable capsule registry: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/lib.rs","lineNumber":1542,"sourceCode":"    fn published_capsule_snapshot(\n        &self,\n        principal: &PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n    ) -> anyhow::Result<Option<astrid_storage::CapsulePackageSnapshot>> {\n        let Some(store) = self.principal_store.as_ref() else {\n            return Ok(None);\n        };\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 owner = astrid_storage::StateOwner::Principal(uid);\n        let capsule_id = astrid_capsule_types::CapsuleId::new(manifest.package.name.clone())\n            .map_err(|error| anyhow::anyhow!(\"invalid durable capsule id: {error}\"))?;\n        store\n            .capsules()\n            .get_snapshot(&owner, capsule_id.as_str())\n            .map_err(|error| anyhow::anyhow!(\"read durable capsule registry: {error}\"))\n    }\n\n    /// Derive the only runtime projection path admitted by this snapshot.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    fn published_cache_target(\n        &self,\n        principal: &PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n        snapshot: &astrid_storage::CapsulePackageSnapshot,\n    ) -> anyhow::Result<PathBuf> {\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 digest = blake3::hash(&snapshot.package().archive)\n            .to_hex()\n            .to_string();\n        astrid_capsule_install::resolve_cache_target_dir(","sourceCodeStart":1524,"sourceCodeEnd":1560,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/lib.rs#L1524-L1560","documentation":"Wraps a failure of `store.capsules().get_snapshot(&owner, capsule_id)`: the durable capsule registry read failed. The owner (Principal UID) and capsule id were valid, but the storage backend could not return the snapshot.","triggerScenarios":"Calling the durable-capsule lookup when the principal's capsule registry entry is unreadable: backend I/O error, lock contention, or a storage-layer failure in astrid_storage.","commonSituations":"Concurrent install/publish racing the read; registry database corrupted or on a full disk; wrong astrid_home so the registry file is absent; permission issues on the registry store after running under a different user.","solutions":["Retry the operation once concurrent installs have finished (lock contention resolves itself)","Check disk space and file permissions on the registry store under astrid_home","Inspect the inner astrid_storage error (included via {error}) for the concrete backend cause","Restore the capsule registry from backup or re-publish the capsule if the store is corrupt"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match store.capsules().get_snapshot(&owner, capsule_id.as_str()) {\n    Ok(snap) => snap,\n    Err(e) if is_contention(&e) => retry_with_backoff(3, || store.capsules().get_snapshot(&owner, capsule_id.as_str())),\n    Err(e) => return Err(anyhow!(\"read durable capsule registry: {e}\")),\n}","preventionTips":["Avoid concurrent installs/publishes for the same principal+capsule","Monitor disk space and permissions on astrid_home","Back up the capsule registry store regularly"],"tags":["storage","registry","capsule","io"],"backgroundTag":"database-query-failed","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"}