{"record":{"id":"e48664d7ff302b10","repo":"NousResearch/hermes-agent","slug":"install-script-invocation-failed-e","errorCode":null,"errorMessage":"install script invocation failed: {e:#}","messagePattern":"install script invocation failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/bootstrap-installer/src-tauri/src/bootstrap.rs","lineNumber":922,"sourceCode":"                    stream: LogStream::Stderr,\n                },\n            );\n            // stderr-level lines get warn! so they're visually distinct\n            // when scrolling through the log later.\n            match &stage_for_stderr_log {\n                Some(name) => {\n                    tracing::warn!(target: \"bootstrap.log\", stage = %name, \"stderr: {line}\")\n                }\n                None => tracing::warn!(target: \"bootstrap.log\", \"stderr: {line}\"),\n            }\n        }),\n    };\n\n    powershell::run_script(script_path, args, sink, hermes_home_override, cancel_rx)\n        .await\n        .map_err(|e| {\n            tracing::error!(?e, \"install script invocation failed\");\n            anyhow!(\"install script invocation failed: {e:#}\")\n        })\n}\n\nfn build_pin_args(script: &install_script::ResolvedScript) -> Vec<String> {\n    let mut out = Vec::new();\n    if let Some(c) = &script.commit {\n        out.push(\"-Commit\".to_string());\n        out.push(c.clone());\n    }\n    if let Some(b) = &script.branch {\n        out.push(\"-Branch\".to_string());\n        out.push(b.clone());\n    }\n    out\n}\n\nfn emit_event(app: &AppHandle, event: BootstrapEvent) {\n    // Tee important state transitions to the rolling installer log so","sourceCodeStart":904,"sourceCodeEnd":940,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/bootstrap-installer/src-tauri/src/bootstrap.rs#L904-L940","documentation":"Raised when powershell::run_script fails to launch or stream the resolved install-main.ps1 script. This is the wrapper error for the entire PowerShell child-process lifecycle: spawning powershell.exe, passing the HERMES_HOME override, streaming stdout/stderr to the log sink, or the cancellation channel aborting. The lower-level cause is chained via {e:#} (anyhow display with chain).","triggerScenarios":"powershell.exe missing from PATH or blocked by policy (Constrained Language Mode / AppLocker); spawning the child fails (exec format, permission); the cancel_rx channel fires because the user cancelled; the script path does not exist at invocation time; HERMES_HOME override points to an unusable directory.","commonSituations":"Corporate Windows machines with PowerShell execution policy set to AllSigned or aAppLocker rules blocking unsigned scripts; PATH mangled so powershell.exe is not found; user clicks Cancel in the installer UI mid-script; antivirus quarantining install-main.ps1 before it runs.","solutions":["Read the chained error {e:#} — it distinguishes spawn failure from cancellation from script failure.","Verify powershell.exe launches: run `powershell -ExecutionPolicy Bypass -File <script>` manually from a terminal.","Check the streamed stderr lines already logged under the `bootstrap.log` target — the actual script error is usually there, not in this wrapper message.","If corporate policy blocks unsigned scripts, exempt HERMES_HOME or run from an unrestricted context."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-flight: powershell must exist and scripts must be runnable.\nfn powershell_available() -> bool {\n    std::process::Command::new(\"powershell\")\n        .args([\"-NoProfile\", \"-Command\", \"exit 0\"])\n        .output()\n        .map(|o| o.status.success())\n        .unwrap_or(false)\n}\n\nif !powershell_available() {\n    eprintln!(\"PowerShell is unavailable or blocked by policy — install cannot proceed.\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = powershell::run_script(script_path, args, sink, override_home, cancel_rx).await {\n    let chain = format!(\"{e:#}\");\n    if chain.contains(\"cancel\") {\n        // user-initiated: exit quietly, not an error\n        return Ok(());\n    }\n    tracing::error!(?e, \"install script invocation failed\");\n    return Err(anyhow!(\"install script invocation failed: {e:#}\"));\n}","preventionTips":["Verify powershell.exe resolves and script execution is permitted before launching the install.","Keep the stderr sink logging to bootstrap.log so real script errors are diagnosable.","Distinguish cancellation from failure in error handling instead of treating both as errors."],"tags":["powershell","windows","bootstrap-installer","child-process"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}