DOP-C02 practice question: Troubleshooting failed deployments and stacks (1 of 3)
Incident and Event Response A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
An online retailer uses CodeDeploy to roll out its order service to a fleet of EC2 instances. The latest deployment failed on a few instances, and the console reports that the AfterInstall lifecycle event failed with a script exit code.
The release is blocked, and the team needs to find the failing command on the affected instances, fix it and get the service running the new version on every instance. The team also needs to keep the instances that succeeded in a consistent state.
The operations team wants the fix to go through the normal deployment path, not manual changes on the servers.
Which TWO actions meet these requirements? (Choose two.)
Choose two answers.
AA. Open the deployment's instance details to see which lifecycle event failed on each instance, then read the script and CodeDeploy agent logs on one affected instance.
BB. Increase the timeout of the AfterInstall hook to one hour and redeploy, on the theory that the script is only slow to finish on some instances.
CC. Remove the AfterInstall hook from the AppSpec file, so that deployments skip the failing script, and deploy the new version to every instance.
DD. Correct the failing command in the revision, publish the new revision, and deploy it to the whole deployment group through the pipeline so that every instance runs the same version.
EE. Log in to each failed instance, run the failing command by hand, and then mark the deployment as successful in the console so that the pipeline can continue.
Show the answer and explanation
Answers: A, D
A. Right: Correct. The deployment's instance records show which lifecycle event failed, and the agent and script logs on the instance show the failing command and its exit code. This points the team to the cause before it changes anything. Learn more: Troubleshooting CodeDeploy (opens in a new tab)
C. Wrong: Skipping the hook removes a step the service depends on, such as configuration setup, so the new version may not run correctly. This is a workaround, not a fix. Learn more: AppSpec file structure (opens in a new tab)
E. Wrong: Manual changes on the servers take the fix outside the deployment path and leave the instances in an inconsistent state. The console does not allow a deployment to be marked successful by hand in this way.
Explanation
The deployment's instance records and the agent and script logs on an affected instance show which lifecycle event failed and why. A corrected revision deployed to the whole group through the normal path fixes the cause and keeps every instance on one version. Longer timeouts, removing the hook and manual changes each leave the cause in place or bypass the process.
Want more on Troubleshooting failed deployments and stacks? The 5 full-length practice sets have 11 more Troubleshooting failed deployments and stacks questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →