125
BashERRORNotableExit CodeHIGH confidence

Command cannot be run by timeout

Production Risk

Indicates the command could not be started at all; check path and permissions.

What this means

Exit code 125 is returned by `timeout` when it cannot execute the command itself — for example, because the command is not found or not executable. Exit code 125 is also used by `git bisect run` to indicate a test that should be skipped.

Why it happens
  1. 1`timeout` cannot execute the given command (not found, not executable)
  2. 2`git bisect run` script exits 125 to tell bisect to skip the current commit
How to reproduce

timeout wrapping a non-executable path.

trigger — this will error
trigger — this will error
timeout 5s /nonexistent/command
echo "Exit: $?"

expected output

bash: /nonexistent/command: No such file or directory
Exit: 125

Fix 1

Verify the command path and permissions

WHEN When timeout returns 125

Verify the command path and permissions
# Check the command exists and is executable
command -v your_command
ls -l /path/to/your_command

Why this works

125 from timeout means the command itself could not be started — fix the path or permissions first.

Fix 2

Use 125 in git bisect to skip commits

WHEN Writing a git bisect run script

Use 125 in git bisect to skip commits
#!/bin/bash
# Return 125 to skip untestable commits
make build 2>/dev/null || exit 125
make test
exit $?

Why this works

git bisect interprets exit 125 as "this commit cannot be tested — skip it" rather than good/bad.

Sources

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Bash errors