astrid-runtime/astrid · error

Capsule '{name}' is not installed.

Error message

Capsule '{name}' is not installed.

What it means

Raised by `update_capsule` in workspace mode when an explicit target capsule is named (`astrid capsule update --workspace <name>`) but the resolved install directory for that capsule does not exist. The updater needs the installed capsule directory (and its meta.json) to find the original source, so updating something that is not installed locally is an immediate error.

Source

Thrown at crates/astrid-cli/src/commands/capsule/install_update.rs:137

    approve_untrusted: bool,
) -> anyhow::Result<()> {
    let home = AstridHome::resolve()?;
    let principal = crate::principal::current();

    if !workspace {
        return update_daemon_capsules(target, &principal, approve_untrusted).await;
    }

    if let Some(name) = target {
        let target_dir = astrid_capsule_install::resolve_target_dir_for_with_layout(
            &home,
            &principal,
            name,
            workspace,
            crate::workspace_layout::current(),
        )?;
        if !target_dir.exists() {
            bail!("Capsule '{name}' is not installed.");
        }

        let meta = read_meta(&target_dir).ok_or_else(|| {
            anyhow::anyhow!(
                "Capsule '{name}' has no meta.json - cannot determine original source. \
                 Re-install it manually."
            )
        })?;

        let source = meta.source.ok_or_else(|| {
            anyhow::anyhow!(
                "Capsule '{name}' was installed before source tracking was added. \
                 Re-install it manually to record the source."
            )
        })?;

        eprintln!("Updating {name} from {source}...");
        // Re-install exactly the capsule being updated. When `source` is a

View on GitHub (pinned to affd8760f4)

Solutions

  1. Run `astrid capsule list` to confirm the exact installed name and where it is installed.
  2. If the capsule is installed by the daemon (not workspace-local), drop the `--workspace` flag and run `astrid capsule update <name>`.
  3. Fix the capsule name typo or install the capsule first with `astrid capsule install <source>`.
  4. Check ASTRID home / workspace layout: if you switched workspaces or principals, the capsule may live under a different path.

Example fix

// before
astrid capsule update --workspace my-capsule
// error: Capsule 'my-capsule' is not installed.

// after — install first, then update
astrid capsule install github.com/org/my-capsule
astrid capsule update --workspace my-capsule
Defensive patterns

Strategy: validation

Validate before calling

let target_dir = resolve_target_dir_for_with_layout(&home, &principal, name, true, layout)?;
if !target_dir.exists() {
    eprintln!("{name} is not installed in this workspace; run: astrid capsule install <source>");
    std::process::exit(1);
}

Type guard

fn is_installed(home: &AstridHome, principal: &PrincipalId, name: &str) -> bool {
    resolve_target_dir_for_with_layout(home, principal, name, true, current())
        .map(|dir| dir.exists())
        .unwrap_or(false)
}

Try / catch

if let Err(e) = update_capsule(Some(name), true, approve).await {
    if e.to_string().ends_with("is not installed.") {
        eprintln!("Unknown capsule '{name}'. Run 'astrid capsule list' first.");
    } else {
        return Err(e);
    }
}

Prevention

When it happens

Trigger: Running `astrid capsule update --workspace <name>` where `resolve_target_dir_for_with_layout` resolves to a directory that does not exist — capsule never installed in this workspace, installed under a different principal/home, typo in the name, or it was uninstalled.

Common situations: Typos in capsule names; switching machines or ASTRID home directories; the capsule is installed daemon-side only (so plain `astrid capsule update <name>` without `--workspace` should be used); capsule removed by hand from the filesystem.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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