Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is deploying a new version of an application to Amazon ECS using the Fargate launch type. The task fails to start and the error message indicates that the task cannot pull the container image from Amazon ECR. What is the MOST likely cause?

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 task execution role lacks permissions to pull from ECR.

The error message indicates a failure to pull the container image from Amazon ECR. The task execution role must have permissions such as ecr:GetDownloadUrlForLayer and ecr:BatchGetImage to pull images. Option A is wrong because the task definition family name does not affect image pulling. Option C is wrong because Fargate does not use host port mapping; container port mapping is handled automatically. Option D is wrong because insufficient CPU or memory typically results in a different error (e.g., task stuck in provisioning), not an image pull failure.

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 task definition family name is incorrect.

    Why it's wrong here

    An incorrect task definition family name would prevent the ECS service or task from finding and launching the specified task definition revision in the first place. However, it does not directly cause an image pull error, which occurs later in the task lifecycle when the container runtime attempts to download the image specified within a successfully identified task definition. The family name primarily serves as an identifier for a collection of task definition revisions.

  • ✓

    The task execution role lacks permissions to pull from ECR.

    Why this is correct

    The task execution role is critical for allowing the Amazon ECS agent to perform necessary actions on your behalf, including pulling container images from private repositories like Amazon ECR. If this role lacks specific permissions such as `ecr:GetDownloadUrlForLayer`, `ecr:BatchGetImage`, and `ecr:BatchCheckLayerAvailability`, the ECS agent will be unauthorized to retrieve the image layers. Consequently, the container runtime will fail to download the image, resulting in a distinct image pull error.

  • ✗

    The container port is not mapped to a host port.

    Why it's wrong here

    Port mapping defines how network traffic is routed to a container after it has successfully started and is running. An image pull error, conversely, occurs much earlier in the task provisioning process, specifically when the container runtime attempts to download the container image from its repository. Therefore, issues with port mapping, or its absence, do not affect the ability to pull the image itself, only how the application inside the container might be accessed later.

  • ✗

    The CPU or memory limits are too low for the container.

    Why it's wrong here

    CPU or memory limits are resource constraints applied to a container once it attempts to start after its image has been successfully pulled. If these limits are set too low, the container might fail to start, crash during execution, or experience performance issues due to resource starvation. However, the act of pulling the container image from the repository precedes the enforcement of these resource limits, meaning insufficient CPU or memory would not manifest as an image pull failure.

About these practice questions

This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.