0

Deployment fails at BeforeInstall event.

Error cod :UnknownError

Script name

Message : CodeDeploy agent was not able to receive the lifecycle event. Check the CodeDeploy agent logs on your host and make sure the agent is running and can connect to the CodeDeploy server.

As checked the codedeploy agent is running fine :The AWS CodeDeploy agent is running as PID ####

And there is no log found inside deployment-instructions. Please help resolve this.

EDITED: No log inside /opt/codedeploy-agent/deployment-root/ or /opt/codedeploy-agent/deployment-root/deployment-group-ID/deployment-ID/

Log seen by running the command: cat /var/log/aws/codedeploy-agent/codedeploy-agent.log

LOGS: 2022-10-13 08:49:03 INFO [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm. 2022-10-13 08:49:48 INFO [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.500434 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")

2022-10-13 08:49:49 INFO [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm. 2022-10-13 08:50:34 INFO [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.061623 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")

2022-10-13 08:50:35 INFO [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm. 2022-10-13 08:51:20 INFO [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.042359 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")

2022-10-13 08:51:21 INFO [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm.

kbc
  • 65
  • 1
  • 7
  • Does this answer your question? [Where are AWS CodeDeploy Deployment logs found?](https://stackoverflow.com/questions/38060534/where-are-aws-codedeploy-deployment-logs-found) – Daniel Lemke Oct 13 '22 at 10:53

1 Answers1

0

Did you check the AWS docs on CodeDeploy log data, and the related thread here on SO? They provide the exact paths (different whether you're using Windows or Linux as deployment targets), where you should find the root cause for the failed deployment.

Daniel Lemke
  • 1,966
  • 18
  • 24
  • I have updated the post with the log in cat /var/log/aws/codedeploy-agent/codedeploy-agent.log but there in no log inside /opt/codedeploy-agent/deployment-root/ or /opt/codedeploy-agent/deployment-root/deployment-group-ID/deployment-ID/ – kbc Oct 13 '22 at 11:04