astrid-runtime/astrid · error

daemon metadata lookup failed: {error}

Error message

daemon metadata lookup failed: {error}

What it means

`show_tree` queries the daemon for capsule dependency metadata and expects a `KernelResponse` carrying capsule entries. When the daemon explicitly answers with a `KernelResponse::Error`, the inner error text is re-wrapped as `daemon metadata lookup failed: {error}`. The daemon was reachable and understood the request, but the lookup itself failed on its side.

Source

Thrown at crates/astrid-cli/src/commands/capsule/deps.rs:155

}

// ---------------------------------------------------------------------------
// Display
// ---------------------------------------------------------------------------

/// Show the capsule dependency tree (imports/exports graph).
pub(crate) async fn show_tree() -> anyhow::Result<()> {
    let mut client = crate::socket_client::connect_kernel_for_workspace(None).await?;
    let capsules = match client.request(KernelRequest::GetCapsuleMetadata).await? {
        KernelResponse::CapsuleMetadata(entries) => entries
            .into_iter()
            .map(|entry| CapsuleDependencyMetadata {
                name: entry.name,
                imports: entry.imports,
                exports: entry.exports,
            })
            .collect::<Vec<_>>(),
        KernelResponse::Error(error) => bail!("daemon metadata lookup failed: {error}"),
        other => bail!("unexpected daemon metadata response: {other:?}"),
    };

    if capsules.is_empty() {
        println!("{}", Theme::info("No capsules installed."));
        return Ok(());
    }

    let (all_trees, unsatisfied) = build_dep_graph(&capsules);

    for (i, tree) in all_trees.iter().enumerate() {
        if i > 0 {
            println!();
        }

        println!("{}", tree.name.bold());

        // Show exports.

View on GitHub (pinned to affd8760f4)

Solutions

  1. Read the wrapped `{error}` text after the colon — it is the daemon's own failure reason and points to the root cause.
  2. Restart the kernel daemon and retry.
  3. Check daemon logs for the underlying metadata lookup failure.
  4. Reinstall the affected capsule if its metadata record is corrupt.
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure the daemon is healthy and reachable before the metadata request
let health = client.ping().await?;
if !health.healthy { return Err(anyhow::anyhow!("daemon unhealthy: {}", health.detail)); }

Type guard

fn take_metadata(resp: KernelResponse) -> Result<Vec<CapsuleMetadata>, String> {
    match resp {
        KernelResponse::Metadata(m) => Ok(m),
        KernelResponse::Error(e) => Err(e),
        other => Err(format!("unexpected variant: {other:?}")),
    }
}

Try / catch

match daemon.request(MetadataQuery).await {
    Ok(KernelResponse::Metadata(m)) => show(m),
    Ok(KernelResponse::Error(e)) => {
        eprintln!("daemon metadata lookup failed: {e}");
        eprintln!("check daemon logs; restarting the kernel often clears this");
    }
    Ok(other) => eprintln!("unexpected daemon response: {other:?}"),
    Err(e) => eprintln!("daemon unreachable: {e:#}"),
}

Prevention

When it happens

Trigger: Calling the metadata request from show_tree (crates/astrid-cli/src/commands/capsule/deps.rs) when the kernel responds with `KernelResponse::Error` — e.g. its metadata store is unavailable, a capsule record is corrupt, or the daemon refused the query internally.

Common situations: Kernel daemon degraded after a crash or partial migration; a capsule installed with missing metadata; daemon version handling the metadata request differently; permissions problems on the daemon's state directory.

Related errors


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