{"record":{"id":"8942bed424d661c1","repo":"astrid-runtime/astrid","slug":"capsule-name-is-not-installed","errorCode":null,"errorMessage":"Capsule '{name}' is not installed.","messagePattern":"Capsule '(.+?)' is not installed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_update.rs","lineNumber":137,"sourceCode":"    approve_untrusted: bool,\n) -> anyhow::Result<()> {\n    let home = AstridHome::resolve()?;\n    let principal = crate::principal::current();\n\n    if !workspace {\n        return update_daemon_capsules(target, &principal, approve_untrusted).await;\n    }\n\n    if let Some(name) = target {\n        let target_dir = astrid_capsule_install::resolve_target_dir_for_with_layout(\n            &home,\n            &principal,\n            name,\n            workspace,\n            crate::workspace_layout::current(),\n        )?;\n        if !target_dir.exists() {\n            bail!(\"Capsule '{name}' is not installed.\");\n        }\n\n        let meta = read_meta(&target_dir).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Capsule '{name}' has no meta.json - cannot determine original source. \\\n                 Re-install it manually.\"\n            )\n        })?;\n\n        let source = meta.source.ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Capsule '{name}' was installed before source tracking was added. \\\n                 Re-install it manually to record the source.\"\n            )\n        })?;\n\n        eprintln!(\"Updating {name} from {source}...\");\n        // Re-install exactly the capsule being updated. When `source` is a","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_update.rs#L119-L155","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `astrid capsule list` to confirm the exact installed name and where it is installed.","If the capsule is installed by the daemon (not workspace-local), drop the `--workspace` flag and run `astrid capsule update <name>`.","Fix the capsule name typo or install the capsule first with `astrid capsule install <source>`.","Check ASTRID home / workspace layout: if you switched workspaces or principals, the capsule may live under a different path."],"exampleFix":"// before\nastrid capsule update --workspace my-capsule\n// error: Capsule 'my-capsule' is not installed.\n\n// after — install first, then update\nastrid capsule install github.com/org/my-capsule\nastrid capsule update --workspace my-capsule","handlingStrategy":"validation","validationCode":"let target_dir = resolve_target_dir_for_with_layout(&home, &principal, name, true, layout)?;\nif !target_dir.exists() {\n    eprintln!(\"{name} is not installed in this workspace; run: astrid capsule install <source>\");\n    std::process::exit(1);\n}","typeGuard":"fn is_installed(home: &AstridHome, principal: &PrincipalId, name: &str) -> bool {\n    resolve_target_dir_for_with_layout(home, principal, name, true, current())\n        .map(|dir| dir.exists())\n        .unwrap_or(false)\n}","tryCatchPattern":"if let Err(e) = update_capsule(Some(name), true, approve).await {\n    if e.to_string().ends_with(\"is not installed.\") {\n        eprintln!(\"Unknown capsule '{name}'. Run 'astrid capsule list' first.\");\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["Run `astrid capsule list` and copy exact names instead of typing from memory.","Remember daemon-installed capsules need `astrid capsule update <name>` without --workspace.","After switching ASTRID home or principal, re-check which capsules are installed locally.","Use uninstall commands rather than deleting capsule directories by hand."],"tags":["cli","filesystem","capsule"],"backgroundTag":"resource-not-found","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}