본문 바로가기
Error

AWS Pipeline을 통한 배포 자동화에서 겪은 오류

by 2D3 2022. 10. 22.
728x90

문제상황

EC2 인스턴스에 역할을 부여하고 EC2에서 파이프라인을 구축하고 있었다.

그 때까지는 다 잘 될 것 같았다...

하지만!!!!!!

웹에서 로그를 보면 Unknown이라고 할 뿐.... 별 다른 답을 주지 않았다.

그래서 콘솔창에서 로그를 까봐야 되겠다 싶어서 로컬에서 로그를 확인했다.

/var/log/aws/codedeploy-agent 경로에서 로그 파일을 확인할 수 있다.


오류메시지

booting child: error during start or run: Net::OpenTimeout - execution expired - /usr/lib/ruby/2.7.0/net/http.rb:960:in 'initialize'

booting child: error during start or run: SystemExit - exit - /opt/codedeploy-agent/lib/instance\_agent/runner/child.rb:90:in 'exit'

On Premises config file does not exist or not readable


 

시도

 

1.CodeDeploy Agent 재설치

$ sudo apt update
$ sudo apt install ruby-full
$ sudo apt install wget
$ cd /home/ubuntu
$ sudo wget https://aws-codedeploy-ap-northeast-2.s3.ap-northeast-2.amazonaws.com/latest/install
$ sudo chmod +x ./install
$ sudo ./install auto > /tmp/logfile

실행중인지 확인을 위해 아래의 명령어를 입력했다

sudo service codedeploy-agent status

잘 실행되고 있었다.

The AWS CodeDeploy agent is running as PID 1211

 

2. codedeploy 재시작

재시작을 했다. 여전히 되지 않았다..

sudo service codedeploy-agent restart

 

3. Ruby 재설치

오류를 읽어보면 ruby가 제대로 동작하지 않는 것 같았다.

루비를 다시 설치했다.

apt update
apt -y install ruby

cd /home/ubuntu
rm -rf install (원래 있던 폴더를 지움)
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install;
chmod +x ./install

./install auto

service codedeploy-agent start

여전히 오류가 났다...

 


해결방법

시작과 끝부분에서 오류가 발생하는 것 같아 쉘 파일을 제대로 읽었다..

cd /home/ubuntu/build 라는 코드가 있었는데...

 

내 로컬에는 ubuntu도 build도 폴더가 없었다.

그렇다.... 이건 EC2에서 진행해야 되는 건데.. 로컬에서 하니까 계속 에러가 발생한 것이었다.

 

교훈

코드를 무지성 복붙하지 말고 읽어보자!🥲🥲🥲

728x90

'Error' 카테고리의 다른 글

[Postman] null 응답 2  (0) 2022.10.31
[Postman] null 응답  (0) 2022.10.31
[JAVA] Application run failed  (2) 2022.10.31
npm 설치 오류  (0) 2022.10.22
H2 실행, 설치 불가 오류 해결  (0) 2022.10.22

댓글