Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: The overall deployment failed because too many individual instances failed deployment

I'm trying to deploy using CircleCI -> S3 -> CodeDeploy -> EC2. I was able to upload deploy image onto S3 from CircleCI, but unable to deploy S3 to EC2 instance. Here's the error.

The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. (Error code: HEALTH_CONSTRAINTS)

The error was provided from CodeDeploy. I can't figure out why and how. I'd appreciate if you give some advise.

like image 988
Noriaki Takamizawa Avatar asked Jul 05 '16 05:07

Noriaki Takamizawa


People also ask

What should be checked first when an AWS CodeDeploy deployment fails?

Here's the steps I would take: Confirm that you installed the CodeDeploy agent. Confirm that you've created the IAM service role. Confirm that you have the IAM Instance Profile and that it's associated with the instance.

Where can I find CodeDeploy logs?

Go to the CloudWatch console, and choose Logs. To view the CodeDeploy agent log, choose codedeploy-agent-logs. To view the deployment scripts log, choose codedeploy-deployment-logs. To view the CodeDeploy agent updater log, choose codedeploy-updater-logs.


1 Answers

If you are running on Ubuntu there might be plenty of reasons, here is a checklist can verify

Check code-deploy agent is installed on your EC2 Instance. Please refer this document to install code deploy agent. https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html

$ sudo service codedeploy-agent status

In case if you are running Ubuntu release 20.x and you get this error

./install:22:in block in method_missing': undefined method path' for #<IO:> (NoMethodError)

try running the install file via this script

sudo ./install auto > /tmp/logfile
  1. Check you have EC2 Instance Code Deploy Role -> Create a code deployment role and assign it to the Instance, https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-service-role.html.

In case if you assign the EC2 Role after initiate, restart the server.

  1. Check your appsec.yml file placement as per the top answer, try to avoid any long timeout in it.

  2. Log into your instance check your error log

$ tail -f /var/log/aws/codedeploy-agent/codedeploy-agent.log

like image 148
kishorekumaru Avatar answered Nov 15 '22 10:11

kishorekumaru