Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

Network Topology
$ aws lambda invokefunction-name my-function out.txtpayload '{"key1":"value1"}'log-type Tailquery 'LogResult'output textdecodeRefer to the exhibit.START RequestId: 123456-abcd-7890END RequestId: 123456-abcd-7890

A developer invoked a Lambda function and saw the above output. What is the root cause of the error?

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 function code expects a property that is missing from the event payload.

The correct answer is B: the function code expects a property that is missing from the event payload. In Lambda, when the handler accesses a key on the parsed event object (e.g., event['detail'] or event.detail) that does not exist, the runtime raises a KeyError or TypeError, which surfaces as an invocation error in the response. This is a data-shape mismatch between what the code reads and what the caller sent, not an infrastructure or configuration failure. Option A is wrong because payload access is not gated by IAM permissions; the event is always delivered to the handler. Option C is wrong because an incorrect handler name produces a Runtime.HandlerNotFound or 'handler does not exist' error before any code runs. Option D is wrong because a timeout returns Task timed out after X seconds rather than a missing-property error.

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 Lambda function lacks permission to access the event payload.

    Why it's wrong here

    Lambda function permissions, defined in its execution role, govern access to other AWS services like S3, DynamoDB, or CloudWatch Logs. The event payload, however, is directly passed as an argument to the function's handler by the Lambda runtime itself, not retrieved via an AWS API call requiring IAM permissions. Therefore, a permission issue would manifest as an AccessDenied error when the function attempts to interact with an external AWS resource, not as an inability to process its direct input.

  • ✓

    The function code expects a property that is missing from the event payload.

    Why this is correct

    The observed error, likely a TypeError indicating an attempt to access a property (e.g., 'length') on an 'undefined' value, strongly suggests that a nested property or object expected by the function's code was not present in the incoming event payload. When a JavaScript or Python function tries to dereference a property on an 'undefined' or non-existent object, the runtime throws an exception because the path to the desired property does not exist, causing the execution to halt.

  • ✗

    The Lambda function's handler name is incorrect.

    Why it's wrong here

    If the Lambda function's handler name were incorrect, the Lambda service would be unable to locate the entry point for the function's code within the deployment package. This would result in a HandlerNotFound or InvalidHandler error *before* the function's user code even begins execution. Since the function evidently started running and produced an error from within its logic, the handler was correctly identified and invoked.

  • ✗

    The Lambda function timed out.

    Why it's wrong here

    A Lambda function timeout occurs when the execution duration exceeds the configured maximum time limit. This typically results in a specific "Task timed out after N seconds" error message in CloudWatch Logs and a Timeout invocation error. The observed output, an exception thrown by the function's internal code logic, indicates that the function was actively executing and encountered a programmatic error before its allocated execution time was exhausted.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

One of 1,135 original DVA-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.