NousResearch/hermes-agent · error · anyhow::Error
install script invocation failed: {e:#}
Error message
install script invocation failed: {e:#} What it means
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).
Source
Thrown at apps/bootstrap-installer/src-tauri/src/bootstrap.rs:922
stream: LogStream::Stderr,
},
);
// stderr-level lines get warn! so they're visually distinct
// when scrolling through the log later.
match &stage_for_stderr_log {
Some(name) => {
tracing::warn!(target: "bootstrap.log", stage = %name, "stderr: {line}")
}
None => tracing::warn!(target: "bootstrap.log", "stderr: {line}"),
}
}),
};
powershell::run_script(script_path, args, sink, hermes_home_override, cancel_rx)
.await
.map_err(|e| {
tracing::error!(?e, "install script invocation failed");
anyhow!("install script invocation failed: {e:#}")
})
}
fn build_pin_args(script: &install_script::ResolvedScript) -> Vec<String> {
let mut out = Vec::new();
if let Some(c) = &script.commit {
out.push("-Commit".to_string());
out.push(c.clone());
}
if let Some(b) = &script.branch {
out.push("-Branch".to_string());
out.push(b.clone());
}
out
}
fn emit_event(app: &AppHandle, event: BootstrapEvent) {
// Tee important state transitions to the rolling installer log soView on GitHub (pinned to c896c09c42)
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.
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-flight: powershell must exist and scripts must be runnable.
fn powershell_available() -> bool {
std::process::Command::new("powershell")
.args(["-NoProfile", "-Command", "exit 0"])
.output()
.map(|o| o.status.success())
.unwrap_or(false)
}
if !powershell_available() {
eprintln!("PowerShell is unavailable or blocked by policy — install cannot proceed.");
} Try / catch
if let Err(e) = powershell::run_script(script_path, args, sink, override_home, cancel_rx).await {
let chain = format!("{e:#}");
if chain.contains("cancel") {
// user-initiated: exit quietly, not an error
return Ok(());
}
tracing::error!(?e, "install script invocation failed");
return Err(anyhow!("install script invocation failed: {e:#}"));
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- write bootstrap marker failed: {err:#}
- hermes update failed (exit {:?}). See {} for details.
- spawning {} {:?}: {e}
- waiting for child: {e}
- running ditto: {e}
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/e48664d7ff302b10.
Report an issue: GitHub.