{"record":{"id":"9267ce9fe5634c55","repo":"NousResearch/hermes-agent","slug":"spawning-e","errorCode":null,"errorMessage":"spawning {} {:?}: {e}","messagePattern":"spawning (.+?) (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/bootstrap-installer/src-tauri/src/update.rs","lineNumber":826,"sourceCode":"    cmd.args(args)\n        .current_dir(cwd)\n        .stdin(Stdio::null())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped());\n    for (key, value) in envs {\n        cmd.env(key, value);\n    }\n\n    #[cfg(target_os = \"windows\")]\n    {\n        use std::os::windows::process::CommandExt;\n        // CREATE_NO_WINDOW = 0x08000000 — no flashing console behind the GUI.\n        cmd.creation_flags(0x0800_0000);\n    }\n\n    let mut child = cmd\n        .spawn()\n        .map_err(|e| anyhow!(\"spawning {} {:?}: {e}\", program.display(), args))?;\n\n    let stdout = child.stdout.take().expect(\"stdout piped\");\n    let stderr = child.stderr.take().expect(\"stderr piped\");\n    // Same non-UTF-8-safe decode path as powershell::run_script (#67193).\n    let mut out = BufReader::new(stdout);\n    let mut err = BufReader::new(stderr);\n    let mut out_buf = Vec::new();\n    let mut err_buf = Vec::new();\n\n    let stage_owned = stage.map(|s| s.to_string());\n    loop {\n        tokio::select! {\n            line = read_decoded_line(&mut out, &mut out_buf) => match line {\n                Ok(Some(l)) => emit_log(app, stage_owned.as_deref(), LogStream::Stdout, &l),\n                Ok(None) => break,\n                Err(e) => { tracing::warn!(\"stdout read error: {e}\"); break; }\n            },\n            line = read_decoded_line(&mut err, &mut err_buf) => match line {","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/bootstrap-installer/src-tauri/src/update.rs#L808-L844","documentation":"Raised in run_streamed when tokio Command::spawn fails for a helper program (the message names the program path and args). Spawn failures mean the binary could not be executed at all — not found, not executable, or an OS-level error — before any stdout/stderr streaming begins. On Windows the child is spawned with CREATE_NO_WINDOW so it never flashes a console.","triggerScenarios":"hermes shim path from [546] missing or lacking +x on Unix; spawning a .bat/.cmd on Windows where the extension or cmd /c handling matters; PATH-dependent program resolution failing because the updater's env is minimal; exec format error from a truncated/ARM-vs-x86 binary.","commonSituations":"The venv shim exists but its interpreter symlink is broken; a copied install between Intel and Apple Silicon macs; antivirus quarantined the target binary; a script without a shebang spawned directly on Unix.","solutions":["Run the exact command printed in the message ({program} {args}) from a shell to see the OS error directly.","Fix the target: reinstall via the bootstrap installer if the shim/binary is missing or not executable (chmod +x on Unix).","Check architecture match of the binary vs the machine if you get an exec format error.","Restore the binary if antivirus quarantined it and exempt the install root."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"use std::os::unix::fs::PermissionsExt;\n\nfn spawnable(path: &std::path::Path) -> bool {\n    match std::fs::metadata(path) {\n        Ok(m) => m.is_file() && (!cfg!(unix) || m.permissions().mode() & 0o111 != 0),\n        Err(_) => false,\n    }\n}\n\nif !spawnable(&hermes) {\n    eprintln!(\"{} is missing or not executable — repair the install.\", hermes.display());\n}","typeGuard":null,"tryCatchPattern":"match cmd.spawn() {\n    Ok(child) => child,\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        // missing binary: repairable — point at re-running the installer\n        return Err(anyhow!(\"{} not found — re-run the installer to repair\", program.display()));\n    }\n    Err(e) => return Err(anyhow!(\"spawning {} {:?}: {e}\", program.display(), args)),\n}","preventionTips":["Check the target binary exists and is executable before spawning.","Don't move installs between architectures or volumes with venvs — venv shims break.","Exempt the install root from antivirus quarantine so spawned binaries don't vanish."],"tags":["child-process","spawn","update","bootstrap-installer"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}