DVA-C02 Deployment Practice Question
A company is using AWS CodeDeploy to deploy a web application to an Auto Scaling group. The deployment fails with the error message 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available, or some instances in your deployment group are experiencing problems.' The developer checks the deployment logs and finds that the ApplicationStop hook failed on some instances. What is the most likely cause of this failure?
⚠ Common exam trap
Many candidates confuse the order of lifecycle hooks or assume a capacity issue, but the specific error message points directly to the ApplicationStop hook, making the missing or incompatible script 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 ApplicationStop script is not compatible with the instance operating system or is missing.
The error message indicates that the ApplicationStop hook failed on some instances. The ApplicationStop hook is a lifecycle event that runs a script to stop the application before a new deployment begins. If the script is missing, incompatible with the instance's operating system, or has incorrect permissions, it will fail, causing the deployment to abort. This is the most direct cause of the failure described.
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 ValidateService hook script is failing.
Why it's wrong here
The ValidateService hook executes late in the CodeDeploy lifecycle, specifically after the new application version has been installed and started on the instance. If this script were failing, it would indicate that the application successfully deployed and started, but then failed a post-deployment health check or validation. This scenario does not align with an initial deployment failure that prevents the application from even starting or installing.
- ✗
The BeforeInstall hook script is incorrectly configured.
Why it's wrong here
The BeforeInstall hook is designed to prepare the instance for the new application revision, running after the ApplicationStop hook has completed. If ApplicationStop itself is the root cause of the deployment failure, then BeforeInstall would either not execute at all or would encounter an environment that was not properly prepared by a successful stop operation. Therefore, BeforeInstall failing would typically be a secondary symptom, not the primary issue if ApplicationStop is problematic.
- ✗
The Auto Scaling group does not have enough capacity to perform the deployment.
Why it's wrong here
An Auto Scaling group lacking sufficient capacity primarily impacts the provisioning of new instances or the ability to replace unhealthy ones, not the execution of deployment scripts on existing, healthy instances. Such a problem would typically manifest as instances failing to launch, being stuck in a pending state, or CodeDeploy reporting an insufficient number of target instances. It would not directly cause a specific application lifecycle hook script to fail during an in-place deployment on an already provisioned instance.
- ✓
The ApplicationStop script is not compatible with the instance operating system or is missing.
Why this is correct
The ApplicationStop hook is one of the earliest lifecycle events in a CodeDeploy deployment, especially crucial for in-place updates where the existing application must be gracefully shut down. If this script is missing from the appspec.yml, has incorrect file permissions, contains syntax errors, or uses commands incompatible with the instance's operating system or shell, the deployment will immediately fail at this critical initial stage. This directly prevents subsequent deployment steps from executing, causing a hook failure.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.