Skip to content

[Bug]: spawn EBADF error on all exec tool calls** #2532

@nucreature

Description

@nucreature

Bug: spawn EBADF error on all exec tool calls

Environment:

  • macOS 15.6.0 (arm64) — Mac mini
  • Clawdbot 2026.1.24-3
  • Tested on Node v25.4.0 and v22.x (same issue on both)
  • exec config: security: "full", ask: "off"

Problem:
The exec tool fails with spawn EBADF on every command. Browser tool works fine (can start Chrome, navigate, etc.), but any exec call fails immediately.

Error from gateway logs (verbose mode):

[exec] spawn failed (spawn EBADF syscall=spawn errno=-9); retrying with no-detach.
tools: exec failed stack: Error: spawn EBADF
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:796:9)
    at spawnAndWaitForSpawn (file:///...clawdbot/dist/process/spawn-utils.js:28:19)
    at spawnWithFallback (file:///...clawdbot/dist/process/spawn-utils.js:78:33)
    at runExecProcess (file:///...clawdbot/dist/agents/bash-tools.exec.js:284:36)

What I've tried (none fixed it):

  • Machine reboot
  • Gateway restart (pkill -f clawdbot-gateway && clawdbot gateway start)
  • npm update/reinstall (npm uninstall -g clawdbot && npm install -g clawdbot)
  • Downgrading from Node 25 to Node 22 LTS
  • Clearing /tmp/clawdbot-*

Key observation:
Node itself spawns fine:

node -e "require('child_process').execSync('echo hello', {stdio:'inherit'})"
# Output: hello

So the issue is specific to how Clawdbot's spawn-utils.js calls spawn, not a system-level problem.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions