[aws]elastic beanstalk 질문입니다


  • Level 9

    현재 ROR을 올리고 있습니다.

    Application update failed at 2019-10-22T05:01:16Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/12_db_migration.sh failed.

    ++ /opt/elasticbeanstalk/bin/get-config container -k script_dir

    • EB_SCRIPT_DIR=/opt/elasticbeanstalk/support/scripts
      ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
    • EB_APP_STAGING_DIR=/var/app/ondeck
      ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
    • EB_APP_USER=webapp
      ++ /opt/elasticbeanstalk/bin/get-config container -k support_dir
    • EB_SUPPORT_DIR=/opt/elasticbeanstalk/support
    • . /opt/elasticbeanstalk/support/envvars-wrapper.sh
      +++ /opt/elasticbeanstalk/bin/get-config container -k support_dir
      ++ EB_SUPPORT_DIR=/opt/elasticbeanstalk/support
      ++ set +x
    • RAKE_TASK=db:migrate
    • . /opt/elasticbeanstalk/support/scripts/use-app-ruby.sh
      ++ . /usr/local/share/chruby/chruby.sh
      +++ CHRUBY_VERSION=0.3.9
      +++ RUBIES=()
      +++ for dir in '"$PREFIX/opt/rubies"' '"$HOME/.rubies"'
      +++ [[ -d /opt/rubies ]]
      ++++ ls -A /opt/rubies
      +++ [[ -n ruby-1.9.3-p551
      ruby-2.0.0-p648
      ruby-2.1.10
      ruby-2.2.10
      ruby-2.3.8
      ruby-2.4.9
      ruby-2.5.7
      ruby-2.6.5
      ruby-current ]]
      +++ RUBIES+=("$dir"/)
      +++ for dir in '"$PREFIX/opt/rubies"' '"$HOME/.rubies"'
      +++ [[ -d /.rubies ]]
      +++ unset dir
      +++ cat /etc/elasticbeanstalk/.ruby_version
      ++ chruby 2.6.5
      ++ case "$1" in
      ++ local dir match
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-1.9.3-p551
      ++ case "${dir##
      /}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.0.0-p648
      ++ case "${dir##/}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.1.10
      ++ case "${dir##
      /}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.2.10
      ++ case "${dir##/}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.3.8
      ++ case "${dir##
      /}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.4.9
      ++ case "${dir##/}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.5.7
      ++ case "${dir##
      /}" in
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-2.6.5
      ++ case "${dir##/}" in
      ++ match=/opt/rubies/ruby-2.6.5
      ++ for dir in '"${RUBIES[@]}"'
      ++ dir=/opt/rubies/ruby-current
      ++ case "${dir##
      /}" in
      ++ [[ -z /opt/rubies/ruby-2.6.5 ]]
      ++ shift
      ++ chruby_use /opt/rubies/ruby-2.6.5 ''
      ++ [[ ! -x /opt/rubies/ruby-2.6.5/bin/ruby ]]
      ++ [[ -n '' ]]
      ++ export RUBY_ROOT=/opt/rubies/ruby-2.6.5
      ++ RUBY_ROOT=/opt/rubies/ruby-2.6.5
      ++ export RUBYOPT=
      ++ RUBYOPT=
      ++ export PATH=/opt/rubies/ruby-2.6.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
      ++ PATH=/opt/rubies/ruby-2.6.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
      +++ /opt/rubies/ruby-2.6.5/bin/ruby -
      ++ eval 'export RUBY_ENGINE=ruby;
      export RUBY_VERSION=2.6.5;
      export GEM_ROOT="/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0";'
      +++ export RUBY_ENGINE=ruby
      +++ RUBY_ENGINE=ruby
      +++ export RUBY_VERSION=2.6.5
      +++ RUBY_VERSION=2.6.5
      +++ export GEM_ROOT=/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
      +++ GEM_ROOT=/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
      ++ (( 0 != 0 ))
    • cd /var/app/ondeck
    • su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb db:migrate' webapp
      /home/webapp is not a directory.
      Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
    • '[' false = true ']'
    • su -s /bin/bash -c 'leader_only bundle exec rake db:migrate' webapp
      /home/webapp is not a directory.
      Bundler will use /tmp/bundler/home/webapp' as your home directory temporarily. rake aborted! PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? /opt/rubies/ruby-2.6.5/bin/bundle:23:inload'
      /opt/rubies/ruby-2.6.5/bin/bundle:23:in `<main>'
      Tasks: TOP => db:migrate
      (See full trace by running task with --trace).
      Incorrect application version "app-4b3b-191022_132025-1" (deployment 4). Expected version "app-4b3b-191022_132025" (deployment 3).
      100 % of CPU is in use.

    이런 에러가 뜨는데 어떻게 처리해야하나요?

  • Level 9

    postgresql에 superuser 권한을 주는것으로 해결하였습니다!

  • Level 1

    eb local run 으로 로컬 상에서 테스트 해보셔도 같은 문제가 발생하나요?
    개인적으로 eb 사용시에 Dockerfile을 정의해서 사용하시길 권장드립니다.
    서버에 올라가기 전에 해야할 명령어들을 미리 정의하는 것이 쉬워집니다!

  • Level 9

    로컬기반 PostgreSQL은 직접적으론 안깔아봤는데, 자료 찾다 나온게 있어서 공유드립니다!
    https://medium.com/@jameshamann/deploying-rails-5-app-using-elastic-beanstalk-and-postgresql-8ca19bc7648a

    혹시 AWS RDS 기반 PostgreSQL와 Rails 프로젝트와 Remote 연결을 하는 경우 이 글을 참고해주세요!
    https://blog.naver.com/kbs4674/221420109694

  • Level 9

    PostgreSQL 서버 관련 오류 같아보이네요.. PostgreSQL 설정(서버가 켜있다던지; role을 만들었다던지 등)은 되어있나요?

ONLINE USERS

POPULAR TOPICS

SUGGESTED TOPICS

  • 4
  • 3
  • 9
  • 4
  • 1
  • 6
  • 7
  • 3