본문 바로가기
개발/aws

aws CodeDeploy 실행중인데 배포 실패할때

by 황태고블린 2022. 7. 14.

에러메세지

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.

 

ec2를 새로 세팅하면서 기존 설정대로 했다고 생각했는데 CodeDeploy 배포중 위 메세지가 나오면서 배포가 실패했습니다. 윈도우서버를 사용중인데 일단 에이전트가 잘 돌아가는지 확인해보니 에이전트는 정상이고 서버에 남아있는 로그를 확인해봐야 할것 같아서 로그를 확인해봤습니다.

 

2022.07.12 - [aws/aws] - Windows Server용 CodeDeploy 에이전트 설치 및 상태확인

 

서버 로그파일 경로는 C:\ProgramData\Amazon\CodeDeploy\log 폴더에 있습니다.

파일경로

에러메시지는 이렇게 나왔는데


Errno::ETIMEDOUT: Failed to open TCP connection to codedeploy-commands.ap-northeast-2.amazonaws.com:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) for "codedeploy-commands.ap-northeast-2.amazonaws.com" port 443)


443 포트 접속이 계속 실패하길래 ec2 보안그룹에서 인바운드 규칙만 살펴보다 아웃바운드쪽 규칙을 살펴보니 포트범위가 전체로 되어있어야 하는데 일부 제약이 걸린 상태로 설정되어있어 전체로 설정하고 다시 해보니 잘 되네요.

인바운드규칙
포트범위를 전체로 수정했습니다

 

codedeploy 가 아마존쪽에 접속해야 되는데 아웃바운드 제약때문에 접속이 안되 계속 에러가 났던 모양입니다.

댓글