Question 134 of 724
DVA-C02 Deployment Practice Question
A company uses CodePipeline to deploy a web application to Elastic Beanstalk. The deployment fails at the Build stage with an error 'BUILD FAILED'. Which step should the developer take first to troubleshoot?
⚠ Common exam trap
The trap here is that candidates may jump to checking Elastic Beanstalk logs or CloudTrail, assuming the failure is related to deployment or API issues, when the error clearly indicates a build-stage failure that is most often caused by a misconfigured buildspec.yml file.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Review the buildspec.yml file for syntax errors
The error 'BUILD FAILED' originates from the Build stage, which is executed by CodeBuild. The first step in troubleshooting a CodeBuild failure is to review the buildspec.yml file for syntax errors or misconfigurations, as this file defines the build commands, environment variables, and phases. Incorrect YAML formatting, missing required fields (e.g., 'phases'), or invalid commands will cause the build to fail immediately, making it the most direct and logical starting point.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Review the buildspec.yml file for syntax errors
Why this is correct
When a CodePipeline build stage fails, the `buildspec.yml` file is the primary configuration for the AWS CodeBuild project responsible for compiling code, running tests, and packaging artifacts. Syntax errors within this YAML file, such as incorrect indentation, invalid commands, or missing required phases, will directly prevent CodeBuild from executing its defined steps successfully. Reviewing the CodeBuild project logs, which detail the execution of each command specified in `buildspec.yml`, is crucial for identifying the exact line or phase where the build process encountered an unrecoverable error.
- ✗
Verify the CodeDeploy application revision
Why it's wrong here
Verifying the CodeDeploy application revision is incorrect because CodeDeploy operates during the deployment stage of a CodePipeline, not the build stage. CodeDeploy is responsible for deploying application revisions to target environments, such as EC2 instances or ECS services, after the build artifacts have been successfully produced by CodeBuild. A failure in the build stage, which occurs prior to deployment, indicates an issue with the source code compilation or packaging, not with how CodeDeploy would handle a revision that hasn't even been generated yet.
- ✗
Examine the Elastic Beanstalk environment logs
Why it's wrong here
Examining Elastic Beanstalk environment logs is an inappropriate step for diagnosing a build failure because these logs primarily capture runtime issues within the deployed application or problems with the underlying infrastructure. Elastic Beanstalk logs, including application server logs (e.g., Apache, Nginx), system logs, and deployment logs, only become relevant once an application has been successfully built and deployed to the environment. A build failure in CodePipeline means the application package never reached the Elastic Beanstalk environment for deployment, thus its logs would not contain information about the build process itself.
- ✗
Check AWS CloudTrail for API calls
Why it's wrong here
Checking AWS CloudTrail for API calls is generally not the correct diagnostic approach for a CodePipeline build failure. CloudTrail records API activity across your AWS account, showing who made what call, when, and from where. While it can indicate if a CodeBuild project was invoked or if there were permission issues preventing CodeBuild from accessing resources, it does not provide granular details about internal build process failures, such as syntax errors within the `buildspec.yml` or compilation errors in the source code. CodeBuild's own detailed build logs are the authoritative source for such diagnostic information.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jul 4, 2026
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.