{"record":{"id":"d3eb5c69338b6811","repo":"astrid-runtime/astrid","slug":"durable-capsule-registry-is-unavailable","errorCode":null,"errorMessage":"durable capsule registry is unavailable","messagePattern":"durable capsule registry is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/capsule_materialization.rs","lineNumber":25,"sourceCode":"impl Kernel {\n    /// Verify every projected byte against one immutable package snapshot.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    pub(crate) fn verify_published_materialization(\n        &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\"))","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/capsule_materialization.rs#L7-L43","documentation":"During materialization verification the kernel's principal_store (the durable capsule registry) is None, so the verified package cannot be read at all. verify_published_materialization requires the durable registry to confirm what was published; without it, verification cannot proceed and fails with this error.","triggerScenarios":"verify_published_materialization() reaches read_verified_durable_package_for_owner while self.principal_store is None — the kernel was constructed without a durable capsule registry backing store.","commonSituations":"Kernel started in a reduced/test configuration without the durable registry; registry initialization failed at startup and was left as None; embedding the kernel library without wiring the principal store.","solutions":["Initialize and attach the principal_store (durable capsule registry) when constructing the kernel","Check kernel startup logs for registry initialization failures and fix the storage backend","Re-run materialization repair/confirm after the registry is available","Ensure the deployment config enables the durable registry rather than a registry-less mode"],"exampleFix":"// before\nlet kernel = Kernel::new(dir, principal_directory, None)?;\n// after\nlet kernel = Kernel::new(dir, principal_directory, Some(principal_store))?;","handlingStrategy":"validation","validationCode":"if kernel.principal_store().is_none() {\n    return Err(\"durable capsule registry not configured; materialization verification unavailable\");\n}","typeGuard":"fn registry_ready(kernel: &Kernel) -> bool {\n    kernel.principal_store().is_some()\n}","tryCatchPattern":"match kernel.verify_published_materialization(...) {\n    Err(e) if e.to_string().contains(\"durable capsule registry is unavailable\") => {\n        eprintln!(\"kernel misconfigured: enable the durable registry\");\n    }\n    other => other?,\n}","preventionTips":["Always initialize the durable capsule registry when constructing the kernel","Fail kernel startup if registry initialization fails instead of leaving it None","Add a config check that rejects registry-less modes where verification is required"],"tags":["durable-registry","misconfiguration","storage"],"backgroundTag":"missing-configuration","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"}