에러모음집

AWS CodeDeploy Error. CodeDeploy agent was not able to receive the lifecycle event.

래니 2024. 3. 20. 09:24
728x90
반응형

 

 

 

💡 
GitHub Actions로 S3에 build 관련 파일 업로드, CodeDeploy로 EC2 서비스 배포 해보기

 

 

 

 

agent도 재설치해봤지만 자꾸만 배포에 바로 실패해버리는 문제

applicationStop 첫단계에서부터 실패

 

 

 

 

오류 문구 

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.

 

 

codeDeploy를 확인해보라고 한다. 

혹시모르니 로그 파일도 확인해봤다.

 

 

agent 로그 파일 확인하는 방법

$ vim /var/log/aws/codedeploy-agent/codedeploy-agent.log

 

로그 파일을 확인해봐도 권한이 없다는 내역만 보인다. 

 

 

원인

  1. CodeDeploy 역할이 인스턴스에 부여되어 있는지 확인
  2. CodeDeploy 의 Agent가 띄워져 있는지 확인

 

 

해결방법

 

1. CodeDeploy 역할이 제대로 부여되어있는지 권한 담당자에게 확인요청함. 

혹시 모르니 다시 역할 재할당 받았다.

 

또는

 

2. 검색해봤는데 아래 경우로 해결한 방법도 있다고 해서 남겨둠

# AWS 자격증명 파일 삭제
$ sudo rm -rf /root/.aws/credentials

# codedeploy-agent 재시작
$ sudo systemctl restart codedeploy-agent

 

 

위 두가지 방법을 하니 되었다. 

둘 중 어느 방법을 통해 되었는지는 사실 정확히 알 수 없었다. 

권한도 다시 받아보고 삭제했다가 다시 재시작 해보고 하니 되었다는 결과..

 

간단하게 정리했지만 1시간 넘게 해결해온 과정들이다.

 

 

 

 

 

 


https://velog.io/@gingaminga/AwsCodeDeployCommandErrorsAccessDeniedException

https://velog.io/@marigold1/S3-의-배포-파일을-CodeDeploy로-불러오지-못하는-error

반응형