astrid-runtime/astrid · error

Distro.lock capsule ' ' is absent from the daemon registry

Error message

Distro.lock capsule '{}' is absent from the daemon registry

What it means

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.

Solutions

  1. Run the distro install/sync so all locked capsules get registered in the daemon registry
  2. Regenerate Distro.lock from the current distro manifest so it only names registered capsules
  3. Check the daemon is running against the expected registry (correct data dir/home)
  4. If the capsule was renamed, update the lock to the new capsule name

Example fix

# before: lock pins "old-capsule" absent from registry
$ astrid init-grant
# after
$ astrid distro sync   # registers locked capsules
$ astrid init-grant
Defensive patterns

Strategy: validation

Validate before calling

fn all_locked_registered(locked: &[DistroLockCapsule], entries: &[RegistryEntry]) -> bool {
    locked.iter().all(|c| entries.iter().any(|e| e.name == c.name))
}

Try / catch

match res {
    Err(e) if e.to_string().contains("absent from the daemon registry") => run_distro_sync_then_retry(),
    other => other,
}

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/0e29d5985ea73276. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-cli/src/commands/init_grant.rs:314

    }
    let result = async {
        let mut client = crate::socket_client::connect_kernel_for_workspace(None).await?;
        let entries = match client
            .request(astrid_core::kernel_api::KernelRequest::GetCapsuleMetadata)
            .await?
        {
            astrid_core::kernel_api::KernelResponse::CapsuleMetadata(entries) => entries,
            astrid_core::kernel_api::KernelResponse::Error(message) => bail!(message),
            other => bail!("unexpected capsule metadata response: {other:?}"),
        };
        let mut installed = Vec::with_capacity(locked.len());
        for capsule in locked {
            let expected = CapsuleId::new(capsule.name.clone())?;
            let entry = entries
                .iter()
                .find(|entry| entry.name == capsule.name)
                .ok_or_else(|| {
                    anyhow::anyhow!(
                        "Distro.lock capsule '{}' is absent from the daemon registry",
                        capsule.name
                    )
                })?;
            if !capsule.version.is_empty() && entry.version != capsule.version {
                bail!(
                    "Distro.lock capsule '{}' expects version {}, but the daemon registry reports {}",
                    capsule.name,
                    capsule.version,
                    entry.version
                );
            }
            let expected_hash = capsule.hash.strip_prefix("blake3:");
            if expected_hash != entry.wasm_hash.as_deref() {
                bail!(
                    "Distro.lock capsule '{}' hash disagrees with the daemon registry",
                    capsule.name
                );

View on GitHub (pinned to affd8760f4)