{"record":{"id":"0e29d5985ea73276","repo":"astrid-runtime/astrid","slug":"distro-lock-capsule-is-absent-from-the-daemon","errorCode":null,"errorMessage":"Distro.lock capsule '{}' is absent from the daemon registry","messagePattern":"Distro\\.lock capsule '(.+?)' is absent from the daemon registry","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/init_grant.rs","lineNumber":314,"sourceCode":"    }\n    let result = async {\n        let mut client = crate::socket_client::connect_kernel_for_workspace(None).await?;\n        let entries = match client\n            .request(astrid_core::kernel_api::KernelRequest::GetCapsuleMetadata)\n            .await?\n        {\n            astrid_core::kernel_api::KernelResponse::CapsuleMetadata(entries) => entries,\n            astrid_core::kernel_api::KernelResponse::Error(message) => bail!(message),\n            other => bail!(\"unexpected capsule metadata response: {other:?}\"),\n        };\n        let mut installed = Vec::with_capacity(locked.len());\n        for capsule in locked {\n            let expected = CapsuleId::new(capsule.name.clone())?;\n            let entry = entries\n                .iter()\n                .find(|entry| entry.name == capsule.name)\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"Distro.lock capsule '{}' is absent from the daemon registry\",\n                        capsule.name\n                    )\n                })?;\n            if !capsule.version.is_empty() && entry.version != capsule.version {\n                bail!(\n                    \"Distro.lock capsule '{}' expects version {}, but the daemon registry reports {}\",\n                    capsule.name,\n                    capsule.version,\n                    entry.version\n                );\n            }\n            let expected_hash = capsule.hash.strip_prefix(\"blake3:\");\n            if expected_hash != entry.wasm_hash.as_deref() {\n                bail!(\n                    \"Distro.lock capsule '{}' hash disagrees with the daemon registry\",\n                    capsule.name\n                );","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/init_grant.rs#L296-L332","documentation":"While validating a lock file for grant reuse, the daemon registry's entry list is searched for each locked capsule by name. If no registry entry matches a locked capsule's name, the lock references a capsule the daemon has never registered. The library refuses to reuse the grant because its locked capsule set cannot be verified against the daemon's actual registry.","triggerScenarios":"`validated_grant_set_for_reuse` iterates Distro.lock capsules and calls `entries.iter().find(|e| e.name == capsule.name)`; `find` returns None, so the error is raised. Happens when the lock was authored for capsules never installed/registered on this daemon, or the registry was wiped/replaced.","commonSituations":"Copying a Distro.lock from another machine to a fresh daemon; registry database reset or recreated with different capsules; capsule renamed upstream while an old lock still pins the previous name; offline daemon without prior sync.","solutions":["Run the distro install/sync so all locked capsules get registered in the daemon registry","Regenerate Distro.lock from the current distro manifest so it only names registered capsules","Check the daemon is running against the expected registry (correct data dir/home)","If the capsule was renamed, update the lock to the new capsule name"],"exampleFix":"# before: lock pins \"old-capsule\" absent from registry\n$ astrid init-grant\n# after\n$ astrid distro sync   # registers locked capsules\n$ astrid init-grant","handlingStrategy":"validation","validationCode":"fn all_locked_registered(locked: &[DistroLockCapsule], entries: &[RegistryEntry]) -> bool {\n    locked.iter().all(|c| entries.iter().any(|e| e.name == c.name))\n}","typeGuard":null,"tryCatchPattern":"match res {\n    Err(e) if e.to_string().contains(\"absent from the daemon registry\") => run_distro_sync_then_retry(),\n    other => other,\n}","preventionTips":["Sync/install the distro on each machine before grant reuse","Do not copy Distro.lock across environments without running sync","Check daemon registry contents with the CLI list command before granting","Handle upstream capsule renames by regenerating the lock"],"tags":["cli","distro-lock","registry","capsule"],"backgroundTag":"entity-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"}