2020년 7월 15일 수요일

Windows10 환경에서 Elastic Beanstalk 배포가 되지 않는 문제


아주 골머리를 썩게 만든 문제가 있었다.

윈도우에서 bat 스크립트로 elastic beanstalk 배포를 위해 zip으로 묶어서 eb deploy를 하면 도무지 성공하지를 못하는 것이다.

During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.

이런 오류 메시지만 남기고서.

이게 풀리지 않는 문제였는데, 의외로 쉽게 해결했다.

eb log를 확인했을때

[ERROR] An error occurred during execution of command [app-deploy] - [StageJavaApplication]. Stop running the command. Error: Command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /tmp/extracted_app_source_bundle failed with error exit status 1. Stderr:warning:  /opt/elasticbeanstalk/deployment/app_source_bundle appears to use backslashes as path separators
 

이런 메시지가 보인다.

use backslashes as path separators

...

윈도우에서 path 구분자로 사용하는 backslash가 문제였다.
그리고 이건 PowerShell의 archive의 버그란다.

https://superuser.com/questions/1382839/zip-files-expand-with-backslashes-on-linux-no-subdirectories

그냥 다른 압축 프로그램으로 묶어서 올리니까 잘된다.

후. 내 시간.