Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Deploy fails without any error message

so I have been trying to setup code deploy for my application, but it keeps on failing. Initially, I didn't have an appspec.yml file in repository, so I got the error message that the appspec.yml file doesn't exist.

I have now included an appspec.yml file, but it still doesn't work and it doesn't give any error message. There are no events mentioned, like it used to before adding the appspec file.

I have less than a beginner's knowledge when it comes to creating a appspec.yml file, but I took hint from a youtube tutorial, and here is the file.

version: 0.0
os: linux
files:
 - source: /
   destination: /var/www/cms

If it helps, the ec2 instance is running an ubuntu server, /var/www/cms is that directory out of which the nginx is supposed to serve files.

like image 879
relentless-coder Avatar asked Jun 15 '17 18:06

relentless-coder


People also ask

What is meaning of code deploy explain with example?

AWS CodeDeploy is a service that automates code deployments to any instance, including Amazon EC2 instances and instances running on-premises. AWS CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during deployment, and handles the complexity of updating your applications.

What is the timeout before a deployment fails if a lifecycle event doesn't start after the previous lifecycle event is completed?

The default timeout for a script in a lifecycle event is 30 minutes.


2 Answers

The most likely problem you're facing is that the agent either isn't installed or the instance doesn't have sufficient permissions. When there are no events started on the instance for the deployment, it means that CodeDeploy couldn't talk to the host for some reasons.

Here's the steps I would take:

  1. Confirm that you installed the CodeDeploy agent
  2. Confirm that you've created the IAM service role
  3. Confirm that you have the IAM Instance Profile and that it's associated with the instance
  4. Check that you can reach the CodeDeploy commands endpoint in your region from the box. i.e. ping codedeploy.us-east-1.amazonaws.com Otherwise, your networking setup might be too restrictive.
  5. Look at the logs on the host to see what's going on
like image 168
EmptyArsenal Avatar answered Sep 28 '22 11:09

EmptyArsenal


I faced at sometime this thing and it was due to the following: If we initially created and turned on the ec2 instance without setting the IAM service role, and after that we added the service role, it will not take effect until we restart the instance.

like image 33
Hussein Hijazi Avatar answered Sep 27 '22 11:09

Hussein Hijazi