{"record":{"id":"c0a5ce650014a9df","repo":"astrid-runtime/astrid","slug":"non-interactive-capsule-configuration-failed","errorCode":null,"errorMessage":"non-interactive capsule configuration failed: {}","messagePattern":"non-interactive capsule configuration failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_finish.rs","lineNumber":50,"sourceCode":"            handle.spawn(async move {\n                headless_elicit_handler(receiver, bus_for_handler, vars, errors).await;\n            })\n        } else {\n            handle.spawn(async move {\n                cli_elicit_handler(receiver, bus_for_handler).await;\n            })\n        }\n    });\n    let result = f(opts, event_bus.clone());\n    if let Some(task) = elicit_task {\n        task.abort();\n    }\n    drop(event_bus);\n    let errors = headless_errors\n        .lock()\n        .map_err(|_| anyhow::anyhow!(\"headless configuration error state was poisoned\"))?;\n    if !errors.is_empty() {\n        bail!(\n            \"non-interactive capsule configuration failed: {}\",\n            errors.join(\"; \")\n        );\n    }\n    result\n}\n\n/// Validate install output, surface diagnostics, and persist manual install\n/// configuration before returning the installed capsule identity.\npub(super) fn finish_install(\n    output: &InstallOutput,\n    home: &AstridHome,\n    principal: &astrid_core::PrincipalId,\n    prompt: &ManualInstallOptions,\n) -> anyhow::Result<InstalledCapsuleOutcome> {\n    let batch = BATCH_MODE.load(std::sync::atomic::Ordering::Relaxed);\n    let manifest_path = output.target_dir.join(\"Capsule.toml\");\n    let manifest = astrid_capsule::discovery::load_manifest(&manifest_path)","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_finish.rs#L32-L68","documentation":"run_with_elicit collects errors raised during headless (non-interactive) capsule configuration into headless_errors. After the run completes, if any were recorded, it joins them with '; ' and bails, so headless installs fail loudly instead of silently proceeding with incomplete configuration.","triggerScenarios":"Running a capsule install non-interactively (e.g. in CI, or via install_from_local_path_for_principal / unpack_via_lib) where an elicitation prompt could not be answered and the elicit handler recorded an error.","commonSituations":"CI jobs with no TTY hitting required [env] fields with no --var supplied; missing non-interactive answers for required configuration; elicit callback failing (e.g. no --var coverage for enum/secret fields).","solutions":["Read the joined messages after 'non-interactive capsule configuration failed:' — each is a specific missing/invalid configuration item.","Supply all required [env] values via --var flags so no interactive elicitation is needed.","Run interactively (with a TTY) once to discover required fields, then script them.","Fix the elicit handler/CI setup if errors are spurious (e.g. poisoned error state)."],"exampleFix":"// before (CI, no vars)\nastrid capsule install --source ./capsule.wasm --principal <id>\n// after\nastrid capsule install --source ./capsule.wasm --principal <id> --var API_TOKEN=... --var LOG_LEVEL=info","handlingStrategy":"validation","validationCode":"// ensure every required [env] field is covered by --var before headless install\nfor key in required_env_keys(\"Capsule.toml\") { assert!(passed_vars.contains(key), \"missing --var {key}\"); }","typeGuard":null,"tryCatchPattern":"catch the error, parse the ';'-joined sub-messages, map each to a missing --var, supply them, and retry once.","preventionTips":["In CI, always run installs with a complete --var set (no TTY = no prompts).","Do one interactive install first to enumerate required fields.","Keep a per-capsule var file/template synced with Capsule.toml's [env] section."],"tags":["configuration","non-interactive","ci","env"],"backgroundTag":"missing-required-config-field","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}