{"record":{"id":"573e8e57357f87bf","repo":"astrid-runtime/astrid","slug":"failed-to-install-capsule-s-names","errorCode":null,"errorMessage":"failed to install {} capsule(s): {names}","messagePattern":"failed to install (.+?) capsule\\(s\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install.rs","lineNumber":552,"sourceCode":"            Err(e) => {\n                eprintln!(\"  Failed to install {name}: {e}\");\n                failed.push((name, e.to_string()));\n            },\n        }\n    }\n\n    eprintln!(\n        \"Done: {} installed, {} failed.\",\n        installed.len(),\n        failed.len()\n    );\n    if !failed.is_empty() {\n        let names = failed\n            .iter()\n            .map(|(n, _)| *n)\n            .collect::<Vec<_>>()\n            .join(\", \");\n        bail!(\"failed to install {} capsule(s): {names}\", failed.len());\n    }\n    Ok(installed)\n}\n\n/// Clone a GitHub repository and build the capsule from source using\n/// `astrid-build`. Returns the installed capsule id.\nasync fn clone_and_build(\n    url: &str,\n    repo: &str,\n    name_hint: Option<&str>,\n    context: InstallContext<'_>,\n) -> anyhow::Result<InstalledCapsuleOutcome> {\n    let tmp_dir = tempfile::tempdir().context(\"failed to create temp dir for cloning\")?;\n    let clone_dir = tmp_dir.path().join(repo);\n\n    let status = std::process::Command::new(\"git\")\n        .args([\"clone\", \"--depth\", \"1\", url, &clone_dir.to_string_lossy()])\n        .status()","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install.rs#L534-L570","documentation":"`install_all_capsules` collects per-capsule failures during a batch GitHub install and, if any failed, aggregates their names into a single `bail!` message. This is a roll-up error: the individual per-capsule failures were already attempted, and the whole install command reports failure listing which capsule names failed.","triggerScenarios":"Running a multi-capsule install (e.g. `astrid capsule install` with a workspace/manifest listing several GitHub sources) where at least one capsule fails to resolve, download, or install; the failed names are joined with commas in the message.","commonSituations":"A workspace capsule manifest references repos whose releases lack `.capsule` assets, network/download failures on one entry, or a capsule name that doesn't exist upstream — the batch aborts after reporting all failures.","solutions":["Read the comma-separated names in the message to identify which capsules failed, then install each failing one individually to see its underlying error","Fix the underlying cause per capsule (missing release asset, bad source URL, network issue)","Remove or correct the failing entries in the capsule manifest/workspace configuration and re-run the batch install","Re-run the install command — successfully installed capsules are tracked, so retry typically only attempts remaining work"],"exampleFix":"// before: manifest references a repo with no .capsule release asset\ncapsules = [\"github:org/good-repo\", \"github:org/broken-repo\"]\n// after: correct or remove the failing entry\ncapsules = [\"github:org/good-repo\", \"github:org/fixed-repo@v1.2.0\"]","handlingStrategy":"try-catch","validationCode":"// Pre-check each capsule source resolves before batch install\nfor source in capsule_sources {\n    if let Err(e) = check_source_resolvable(&source) {\n        eprintln!(\"skipping {}, unresolvable: {e}\", source);\n    }\n}","typeGuard":null,"tryCatchPattern":"match install_from_github(...) {\n    Ok(installed) => println!(\"installed: {installed:?}\"),\n    Err(e) if e.to_string().contains(\"failed to install\") => {\n        // parse failed names after \"failed to install N capsule(s): \"\n        // and retry/install each individually for per-capsule errors\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Validate all entries in a capsule manifest resolve to real repos/releases before batch install","Install new/unknown capsules individually first, then add them to the batch manifest","Keep the manifest free of stale entries pointing at renamed or deleted repos","Re-run batch install after fixing failures — already-installed capsules are reported, not reinstalled"],"tags":["github","capsule","batch-install","aggregated-error"],"backgroundTag":"http-request-failed","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"}