라벨이 Github Actions인 게시물 표시

[AWS] CodeDeploy 오류: The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.

이미지
개발환경은 아래와 같다. - Github Actions - AWS S3 - AWS CodeDeploy  - AWS EC2(ubuntu server v22.04) 위 환경에서 배포 자동화 설정 중 CodeDeploy에서 발생했던 오류를 해결했던 정리하려한다. AWS CodeDeploy Console 오류 화면 오류 메세지: The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. CodeDeploy 콘솔에서 배포 오류 이벤트 내역을 확인해도 되지만 보다 정확한 문제를 확인하기위해서는 CodeDeploy가 실행되는 ec2 인스턴스에 ssh에 접속해 CodeDeploy에 대한 로그를 확인해보는것이 좋다. * Ubuntu EC2 인스턴스에 CodeDeploy agent가 설치되어 있어야 한다. Install the CodeDeploy agent for Ubuntu Server 아래 명령어를 통해 codedeploy agent log가 저장되어있는 위치로 이동한다. $ cd /var/log/aws/codedeploy-agent 아래 명령어를 통해 로그 내역을 확인할 수 있다. $   cat codedeploy-agent.log 나의 경우 로그에 아래와 같이 에러 로그가 찍혀있었다. ERROR [codedeploy-agent(2423)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials - please check if this instance was started with an IAM instance profile INFO  [codedeploy-agent(2423

Type error: Cannot find module ... Github Actions Ubuntu 환경

이미지
  Github Actions로 배포 자동화를 설정하기 위해서 yml 파일을 작성하고 push 했는데 위에 사진과 같이 파일 경로를 찾지 못하는 문제가 발생했다. 로컬 개발환경에서 build시에는 문제가 없는데 Github Actions에서 build시에만  Type error: Cannot find module '@/assets/icons' or its corresponding type declarations. 오류가 발생했다. 오류 해결 과정에서 세웠던 가설들과 해결 과정 3가지를 적어보려한다. 첫번째, 가설:  Next.js 13에서는 터보팩으로 전환했지만 여전히 Webpack을 번들러로 사용하고. Webpack은 TS 컴파일 단계와 다른 단계에서 실행되므로 tsconfig.json을 고려하지 않는다. 그러므로  tsconfig.json의 paths가 제대로 적용되지 않는것이 문제이다. 해결방법: next.config.js에 webpack config.resolve.alias 옵션을 사용해서 @를 경로에 맞게 수정되도록 설정한다. /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: false , webpack ( config ) { config . resolve . alias = { ... config . resolve . alias , '@' : path . join ( __dirname , '/' ), }; return { ... config ,    ...        ... 기타 설정 생략         ... ... 결론: 하지만 나의 경우  동일하게 Cannot find moudle 에러가 발생했다. 두번째,  가설: typescript는 devDependencies에 작성되어 설치되는데 build 할 때 환