Lightsail and CodeDeploy failing on ApplicationStop event

0

Hello, I've tried to set up codedeploy and codepipeline to work with a new instance on lightsail following this documentation: https://aws.amazon.com/blogs/compute/using-aws-codedeploy-and-aws-codepipeline-to-deploy-applications-to-amazon-lightsail/

However I don't get this to pass. It is always failing on ApplicationStop event. Here's the github repo I forked https://github.com/mikegcoleman/CodeDeployGitHubDemo

All the information I get from the CodeDeploy console is 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.

Trying to see the logs in my lightsail instance with less /var/log/aws/codedeploy-agent/codedeploy-agent.log it doesn't seem to be very helpful:

2024-02-07T14:01:35 INFO [codedeploy-agent(26191)]: mstr 26191: Spawned child 1/1 2024-02-07T14:01:36 ERROR [codedeploy-agent(26193)]: Invalid on premises config file 2024-02-07T14:01:36 ERROR [codedeploy-agent(26193)]: booting child: error during start or r un: RuntimeError - The deployment failed because the format of the following on-premises co nfiguration file is invalid: /etc/codedeploy-agent/conf/codedeploy.onpremises.yml - /opt/co dedeploy-agent/lib/instance_agent/plugins/codedeploy/onpremise_config.rb:15:in rescue in c onfigure' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/onpremise_config.rb:11:in conf igure'

My codedeploy.onpremises.yml content is the following


aws_access_key_id: XXXXX aws_secret_access_key: XXXXX iam_user_arn: XXXXX region: us-east-1

I'm using ubuntu 22 for my Lightsail instance.

Are there additional steps I can follow in order to get a more useful log to troubleshoot my issue?

Marco
已提問 3 個月前檢視次數 178 次
1 個回答
0

Update: Used the following command to skip application stop since it will be the first time deploying, tho now it failing on the next step, DownloadBundle. codedeploy-agent log is still the same as in the description, no updates. I'm wondering if it's even connecting to my ligthsail instance. Is there a way I can confirm that?

Marco
已回答 3 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南