Open fienestar opened 2 years ago
Github Action 구성은 정상적으로 S3와 AWS CodeDeploy로 연결됨을 확인했습니다. 하지만 EC2상의 code deploy agent 가 Instance Service로 접근하지 못하고 있습니다.
in /var/log/aws/codedeploy-agent/codedeploy-agent.log
...
2022-10-15 07:04:04 ERROR [codedeploy-agent(1938)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Cannot reach InstanceService: Aws::CodeDeployCommand::Errors::AccessDeniedException -
2022-10-15 07:04:04 DEBUG [codedeploy-agent(1938)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Sleeping 12 seconds.
주의 사항
sudo service codedeploy-agent restart
tail -n {라인수} /var/log/aws/codedeploy-agent/codedeploy-agent.log
로 로그를 확인할 수 있습니다.
시도해본것들
2022-10-15 07:05:22 INFO [codedeploy-agent(1938)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.3.2-1902_deb.
~$ sudo /opt/codedeploy-agent/bin/install auto
I, [..] INFO -- : Starting Ruby version check.
E, [..] ERROR -- : Current running Ruby version for root is 3.0.2, but Ruby version 2.x needs to be installed.
E, [..] ERROR -- : If you already have the proper Ruby version installed, please either create a symlink to /usr/bin/ruby2.x,
E, [..] ERROR -- : or run this install script with right interpreter. Otherwise please install Ruby 2.x for root user.
~$ rbenv install 2.7.0
Downloading ruby-2.7.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.bz2
Installing ruby-2.7.0...
BUILD FAILED (Ubuntu 22.04 using ruby-build 20200401)
Inspect or clean up the working tree at /tmp/ruby-build.20221015072109.3564.T5V3c0 Results logged to /tmp/ruby-build.20221015072109.3564.log
- symlink를 만드는 경우
I, [2022-10-15T07:11:20.150495 #2024] INFO -- : Starting Ruby version check. W, [2022-10-15T07:11:20.150906 #2024] WARN -- : The Ruby version in /usr/bin/ruby2.7 is 3.0.2, . Attempting to install anyway. ... Dependency is not satisfiable: ruby2.0|ruby2.1|ruby2.2|ruby2.3|ruby2.4|ruby2.5|ruby2.6|ruby2.7
E, [2022-10-15T07:11:27.230866 #2024] ERROR -- : Error installing /tmp/codedeploy-agent_1.4.0-2218_all.tmp-20221015-2024-ff7qfh.deb.
- 파일 시스템상의 권한 문제
- ~/.aws 폴더가 생성되질 않아, ~의 권한을 모두 줬지만 여전했습니다.
확인했습니다 고생하셨습니다
Github Action -> S3, AWS Elastic Beanstalk -> EC2