ExitAWS CodeBuild: build failure diagnostics1 / 7
Explanation

Separate the phase result from its context

How build phase statuses, context messages, and execution logs reveal the cause of a failed CodeBuild action. · advanced

A failed CodeBuild action is a summary, not a diagnosis. Open the exact build execution and inspect its phase history. The BatchGetBuilds API exposes this in builds[].phases[]: phaseType identifies where execution was, and phaseStatus records that phase's outcome. A failure in PROVISIONING or DOWNLOAD_SOURCE is not evidence that a compiler command ran.

Read the phase's contexts alongside its status. Each context can contain a statusCode and a message. The status code classifies the problem; the message supplies details such as the command, exit status, or resource involved. For example, COMMAND_EXECUTION_ERROR identifies a command execution failure, but does not by itself distinguish a compiler error from a failed dependency download.

Keep phase type, phase status, and overall build status separate. COMPLETED is a phase type, not proof of success. Likewise, TIMED_OUT or STOPPED should not be interpreted as an ordinary command returning a nonzero exit status.

EvidenceWhat it establishesWhat it does not establish
phaseTypeExecution stageSuccess or failure
phaseStatusPhase outcomeUnderlying technical cause
Context statusCodeFailure categoryComplete diagnosis
Context messageFailure-specific detailsFull command output