DVA-C03 · Domain 4: Troubleshooting and Optimization · 22% of the exam
Task 4.1: Assist in a root cause analysis.
Finding why something broke: debugging code and service integrations, reading metrics, logs and traces, querying logs, the output logs of a failed deployment, and AI tools that analyze errors and suggest fixes.
Study it
Reading metrics, logs and traces to find the cause
Debugging deployments and service integrations from their logs
Lesson coming
AI tools that analyze errors and suggest fixes
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the AWS documentation page that proves it.
Question 1 · choose 1
While testing a new feature in a development account, a developer sends requests to an AWS Lambda function and wants to watch its new log events, filtered to lines that contain a request ID, as they arrive in CloudWatch Logs. What should the developer use?
AA metric filter on the log group with an alarm
BAn export of the log group to Amazon S3
CCloudWatch Logs Live Tail with a filter on the request ID
DA CloudWatch dashboard that graphs the function's Errors metric
Show the answer and why
AA metric filter on the log group with an alarm
Incorrect
Metric filters turn log patterns into metrics; they do not show the log lines as they arrive.
BAn export of the log group to Amazon S3
Incorrect
Exports copy stored logs for later analysis, not a live view.
CCloudWatch Logs Live Tail with a filter on the request ID
Correct
Live Tail streams new log events as they are ingested, with filtering and highlighting in near real time.
DA CloudWatch dashboard that graphs the function's Errors metric
Incorrect
A dashboard shows metrics, not the content of individual log events.
Live Tail is the quick way to watch logs while testing changes.
Users report that an API backed by an AWS Lambda function was slow during the last hour. In the function's log group, the developer wants the 20 slowest invocations of that hour, with their request IDs, to look them up one by one. Which CloudWatch Logs Insights query should the developer run?
Lambda REPORT lines carry the discovered @duration and @requestId fields. Sorting by duration in descending order and limiting to 20 returns the slowest invocations.
Bfilter @type = "REPORT" | stats max(@duration) by bin(5m)
Incorrect
stats aggregates into one value per 5-minute bin, so individual invocations and their request IDs are lost.
A first deployment of an AWS SAM application creates an AWS CloudFormation stack, which fails and ends in ROLLBACK_COMPLETE. The stack's event list is long: dozens of CREATE_IN_PROGRESS, CREATE_COMPLETE and DELETE_COMPLETE events. The developer wants to find the event that most likely caused the failure, and its explanation, as quickly as possible. What should the developer do?
ARead the status reason of the stack's final ROLLBACK_COMPLETE event
BRead the DELETE_COMPLETE events that the rollback produced
CRun drift detection on the stack and review the drifted resources
DRun Detect root cause in the console and read the event it labels
Show the answer and why
ARead the status reason of the stack's final ROLLBACK_COMPLETE event
Incorrect
ROLLBACK_COMPLETE only reports that the resources created during the failed creation were removed. It is the end state, not the cause.
BRead the DELETE_COMPLETE events that the rollback produced
Incorrect
Those events record the cleanup after the failure. They show what was removed, not why the creation failed.
CRun drift detection on the stack and review the drifted resources
Incorrect
Drift detection compares existing resources with the stack template. It does not explain why a stack creation failed.
DRun Detect root cause in the console and read the event it labels
Correct
CloudFormation analyzes the failure and labels the event that is likely the root cause; its Status reason, and sometimes a linked CloudTrail event, gives the details.
For a failed stack, the useful event is the failure that started it all; Detect root cause finds it among the cancellations and rollback events.
A REST API in Amazon API Gateway uses a Lambda proxy integration. The Python handler ends with return {"status": 200, "data": order}. The function's logs show that every invocation succeeds, yet every client receives a 502 Bad Gateway response. What should the developer change?
AReturn {"statusCode": 200, "body": body}, with body as the order in JSON
BTurn on API caching for the method so that responses come from the cache
CIncrease the function's memory so that it returns its result faster
DReturn the original dictionary serialized into one JSON string instead
Show the answer and why
AReturn {"statusCode": 200, "body": body}, with body as the order in JSON
Correct
A proxy integration expects an object with statusCode and a string body (plus optional headers). Any other output format makes API Gateway return 502 Bad Gateway.
BTurn on API caching for the method so that responses come from the cache
Incorrect
Caching stores endpoint responses for a TTL. A malformed response is still malformed, and the first request still reaches the function.
CIncrease the function's memory so that it returns its result faster
Incorrect
Memory adds CPU to the function. The invocations already succeed; the problem is the shape of what the function returns.
DReturn the original dictionary serialized into one JSON string instead
Incorrect
A plain string is still not the output format a proxy integration expects, so API Gateway keeps returning 502.
With Lambda proxy integrations the function owns the HTTP response: statusCode, headers and a string body, or the client sees 502.
A newly created AWS Lambda function calls a partner API that usually answers in four to six seconds. Every invocation fails, and the logs show "Task timed out after 3.00 seconds". The developer did not change any settings after creating the function. What should the developer do?
ARaise the function's memory to 10,240 MB, the largest available setting
BSet reserved concurrency on the function
CTurn on AWS X-Ray active tracing
DRaise the function's timeout above the API's response time
Show the answer and why
ARaise the function's memory to 10,240 MB, the largest available setting
Incorrect
More memory speeds up computation, but the function is waiting on the partner API, so it still stops at the timeout.
BSet reserved concurrency on the function
Incorrect
Concurrency settings do not change how long one invocation may run.
CTurn on AWS X-Ray active tracing
Incorrect
Tracing shows where time is spent but does not stop the timeout.
DRaise the function's timeout above the API's response time
Correct
The default timeout is 3 seconds. Raising it above the partner API's response time lets the call finish.
New functions start with a 3-second timeout; set it to match the slowest expected calls.
Tasks of a new Amazon ECS service on AWS Fargate fail to start with a CannotPullContainerError for an image in Amazon ECR. The tasks run in private subnets without public IP addresses. The error says the connection timed out. What is the most likely cause?
AThe container's health check command is wrong
BThe task definition requests too little memory for the container image
CThe subnets have no network route to Amazon ECR
DThe service's desired count is set too high
Show the answer and why
AThe container's health check command is wrong
Incorrect
Health checks run after the container starts; this task never pulled its image.
BThe task definition requests too little memory for the container image
Incorrect
Memory limits affect running containers, not the network path to the registry.
CThe subnets have no network route to Amazon ECR
Correct
A timeout means there is no route; tasks in private subnets need a NAT gateway or VPC endpoints to reach the registry.
DThe service's desired count is set too high
Incorrect
The number of tasks does not cause an image pull to time out.
CannotPullContainer timeouts point to networking; permission errors point to the task execution role.
An AWS CodeBuild project compiles and tests successfully, but the build fails in the UPLOAD_ARTIFACTS phase with an AccessDenied error for the Amazon S3 output bucket. The bucket was recently changed to a new name. What should the developer check first?
AThe source repository credentials that the project uses to download code
BThe service role's S3 permissions for the new bucket
CThe compute type of the build environment
DThe buildspec's install phase runtime versions
Show the answer and why
AThe source repository credentials that the project uses to download code
Incorrect
The source was already downloaded and built; the failure is when writing artifacts.
BThe service role's S3 permissions for the new bucket
Correct
CodeBuild uses its service role to call other services, including s3:PutObject for the artifact bucket.
CThe compute type of the build environment
Incorrect
Compute size does not affect permissions to write to S3.
DThe buildspec's install phase runtime versions
Incorrect
Runtime versions affect the build, which already succeeded.
AccessDenied in CodeBuild usually points to the service role; check that it covers renamed resources.
A CloudFormation stack update failed, and the automatic rollback also failed because a database instance it needed had been deleted outside CloudFormation. The stack is now in UPDATE_ROLLBACK_FAILED and cannot be updated. What should the developer do?
ADelete the whole stack and recreate it later from the original template file
BRun another stack update with the previous template
CContinue the rollback and skip the resource that cannot roll back
DTurn on termination protection and wait for the stack to recover
Show the answer and why
ADelete the whole stack and recreate it later from the original template file
Incorrect
This destroys the other resources in the stack when the stack can be returned to a working state instead.
BRun another stack update with the previous template
Incorrect
A stack in UPDATE_ROLLBACK_FAILED cannot be updated until the rollback is completed.
CContinue the rollback and skip the resource that cannot roll back
Correct
Continuing the rollback, if needed with the failing resources skipped, returns the stack to UPDATE_ROLLBACK_COMPLETE.
DTurn on termination protection and wait for the stack to recover
Incorrect
Termination protection prevents deletion; the stack does not recover on its own.
Fix the cause or skip the failing resources, then continue the rollback so that the stack can be updated again.
In the AWS X-Ray trace map, a downstream service node shows a high rate of responses marked as errors, while faults stay at zero. A developer must decide where to look first. What do these error marks indicate?
AServer faults, meaning 500 series errors in the downstream service
BThrottling, meaning 429 Too Many Requests responses
CClient errors, meaning 400 series responses
DNetwork timeouts between the two services
Show the answer and why
AServer faults, meaning 500 series errors in the downstream service
Incorrect
X-Ray records 500 series errors as faults, and faults are at zero here.
BThrottling, meaning 429 Too Many Requests responses
Incorrect
X-Ray marks 429 responses as throttles, a separate category.
CClient errors, meaning 400 series responses
Correct
X-Ray marks client errors, the 400 series, as errors, so the requests sent to the service are the first place to look.
DNetwork timeouts between the two services
Incorrect
Errors in X-Ray refer to the response class, not to timeouts between nodes.
In X-Ray, errors are 4xx, faults are 5xx, and throttles are 429.