Skip to content
Latchkey

Bamboo "command not found" on the agent in CI

A script or command task tried to run a tool the agent does not have on PATH or does not define as an executable capability. The shell returns "command not found" and the task exits non-zero.

What this error means

The task log shows "<tool>: command not found" (or "not recognized" on Windows) and the task fails with a non-zero return code.

Bamboo
/bin/sh: 1: mvn: command not found
Failing task since return code of the command was 127

Common causes

The tool is not installed on the building agent

The agent that picked up the job does not have the executable installed, so the shell cannot find it.

The executable is not defined as a capability

The plan uses an executable task whose capability (Maven, Node, a custom command) is undefined on the agent, so Bamboo has no path to run it.

How to fix it

Define the executable capability

  1. Install the tool on the agent host.
  2. Add it as an executable capability on the agent with the correct path.
  3. Add a matching requirement to the job so only capable agents pick it up.
Bamboo administration
# Agents > <agent> > Capabilities > Add capability > Executable
# e.g. Maven 3.9 -> /opt/apache-maven-3.9/bin/mvn

Use an absolute path or restore PATH

If the tool is installed but not on the task PATH, call it by absolute path or export PATH at the top of the script task.

Terminal
export PATH="/opt/apache-maven-3.9/bin:$PATH"
mvn -version

How to prevent it

  • Define required tools as executable capabilities and add matching job requirements.
  • Keep tool installs consistent across agents that build the same plans.
  • Prefer capability-driven task types over bare script calls to a global tool.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →