Course menuDOP-C02

Exams / DOP-C02 / Troubleshooting failed deployments and stacks / Question 1

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.

Last verified against current AWS documentation ·How we write our questions

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.

  1. A. 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.
  2. B. 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.
  3. C. Remove the AfterInstall hook from the AppSpec file, so that deployments skip the failing script, and deploy the new version to every instance.
  4. D. 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.
  5. E. 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)
  • B. Wrong: The message reported a script exit code, not a timeout, so a longer limit will not fix a failing command. The team would also wait longer for each failure. Learn more: AppSpec 'hooks' section (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)
  • D. Right: Correct. A corrected revision released through the deployment path puts every instance on the same version, and no one changes the servers by hand. Automatic rollback settings still protect the fleet if the new revision fails. Learn more: Redeploy and roll back a deployment with CodeDeploy (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.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

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