DOP-C02 CodeBuild DOWNLOAD_SOURCE phase Practice Question
Network Topology
The exhibit shows the output of the AWS CLI command 'batch-get-builds' for a CodeBuild build. The build failed. What is the most likely cause of the failure?
⚠ Common exam trap
Watch out — candidates often assume a build failure is always due to code errors or buildspec issues, but the error message in the CLI output directly points to an S3 permission problem during the DOWNLOAD_SOURCE phase. Unlike artifact uploads which require s3:PutObject, source downloads require s3:GetObject, and candidates must distinguish between the two.
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
✓
The S3 bucket 'my-bucket' does not exist or the build project lacks permissions to access it.
The `batch-get-builds` output shows a failure in the DOWNLOAD_SOURCE phase, with an error indicating that the build could not access the S3 bucket `my-bucket`. The error details, such as 'Access Denied' or 'NoSuchBucket', imply that the CodeBuild service role lacks the required `s3:GetObject` permission on the bucket, or the bucket does not exist. This is a common misconfiguration when the source code is stored in an S3 bucket and the build project is not properly configured to retrieve it.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The source code has compilation errors.
Why it's wrong here
Compilation errors surface as messages from the compiler within the build log's build phase, not as the phase status shown. The exhibit indicates the failure occurred at a different stage, so the cause lies elsewhere in the build lifecycle. It would be tempting when the log explicitly shows compiler diagnostics such as syntax errors.
- ✗
The buildspec file is malformed.
Why it's wrong here
A malformed buildspec produces a specific validation error in the build's phases and typically fails before any commands run, which the exhibit does not show. The failure arises during command execution, pointing to the build commands themselves. It would be tempting when the log shows a YAML parse error at buildspec download.
- ✗
The build project does not have sufficient memory.
Why it's wrong here
Build failures from insufficient memory surface as an out-of-memory kill during the build phase, not as the phase-level status shown in batch-get-builds output. Memory is a compute resource configured on the project; it would be the cause only if logs showed the container being terminated mid-build.
- ✓
The S3 bucket 'my-bucket' does not exist or the build project lacks permissions to access it.
Why this is correct
CodeBuild reports a client error when it cannot retrieve source artefacts, and the build log shows an S3 access failure. Either the bucket 'my-bucket' is absent or the service role lacks s3:GetObject permission, so the build fails before compilation begins.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 1,298 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-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 DOP-C02 exam.