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
demandé il y a 3 mois179 vues
1 réponse
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
répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions