24

最新のコミットまで、Beanstalk 環境に問題なくアプリをデプロイしてきました。

今、私はこれを取得します

Time    Type    Details
2013-09-01 10:19:12 UTC+0800    ERROR   Failed to deploy application.
2013-09-01 10:19:11 UTC+0800    ERROR   Responses from [i-50f40d06] were received, but the commands failed.
2013-09-01 10:19:11 UTC+0800    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2013-09-01 10:19:11 UTC+0800    ERROR   [Instance: i-50f40d06 Module: AWSEBAutoScalingGroup ConfigSet: Hook-PreAppDeploy] Failed on instance with return code: 1 Output: Error occurred during build: Command hooks failed .

スナップショット ログには、次のように記載されています。

2013-09-01 02:19:08,852 [INFO] (9941 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: New python executable in /opt/python/run/venv/bin/python2.6
Not overwriting existing python script /opt/python/run/venv/bin/python (you must use /opt/python/run/venv/bin/python2.6)
Installing distribute..................................................................................................................................................................................................done.
Installing pip................done.
2013-09-01 02:19:08,564 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status -9
Traceback (most recent call last):
  File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 31, in main
    install_dependencies()
  File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 25, in install_dependencies
    shell=True)
  File "/usr/lib/python2.6/subprocess.py", line 502, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status -9

2013-09-01 02:19:08,853 [ERROR] (9941 MainThread) [directoryHooksExecutor.py-34] [root directoryHooksExecutor error] Script failed with returncode 1
2

私の requirements.txt は以前と同じです。私もrequirements.txtのすべてを削除しようとしましたが、同じエラーが再び表示され、requirements.txtが実行される前に問題があったと思われます。

物事が展開される順序がわかりません。とにかく、ここに私の設定ファイルがあります:

packages:
  yum:
    libjpeg-devel: '6b'
    zlib-devel: []
    freetype-devel: []


container_commands:
  01_install_mysqldb:
    command: "pip install distribute==0.6.28; pip install mysql-python;"
  02_syncdb:
    command: "python manage.py syncdb --noinput"
    leader_only: true
  03_createadmin:
    command: "python scripts/createadmin.py"
    leader_only: true
  04_collectstatic:
    command: "python manage.py collectstatic --noinput"
  05_migrate_wizards:
    command: "python manage.py migrate wizards --noinput"
    leader_only: true
  06_migrate_facebook:
    command: "python manage.py migrate facebook --noinput"
    leader_only: true
  07_migrate_socialaccount:
    command: "python manage.py migrate socialaccount 0011 --noinput"
    leader_only: true
  08_migrate_missions:
    command: "python manage.py migrate missions --noinput"
    leader_only: true
  09_migrate_mailchimp:
    command: "python manage.py migrate mailchimp --noinput"
    leader_only: true
  10_migrate_actstream:
    command: "python manage.py migrate actstream --noinput"
    leader_only: true

option_settings:
  - namespace: aws:elasticbeanstalk:container:python
    option_name: WSGIPath
    value: ideatory/wsgi.py
  - namespace: aws:elasticbeanstalk:container:python:staticfiles
    option_name: /static/
    value: static/
  - option_name: DJANGO_SETTINGS_MODULE
    value: ideatory.settings
4

5 に答える 5

17

私はまったく同じ問題を抱えていました。私にとってうまくいった唯一のことは、(自動的に)環境全体を再構築することでした。これは AWS コンソールで実行できます。環境に移動し、[アクション] > [環境の再構築] をクリックします。これにはしばらく時間がかかります。その後、このエラーなしでアプリが自動的に再起動されます。

アップデート:

問題は時々戻ってきます。psycopgpostgreSQL のサポートに必要なpip のコンパイル時に何か問題が発生していることがわかりました。根本的な解決策はまだ見つかっていません。

于 2014-01-07T13:48:29.013 に答える
13

postgresql93-develとを追加することで、この作業を行うことができましpostgresql93.ebextensions

Linux を実行している EC2 インスタンスでのソフトウェアのカスタマイズで説明されているとおり

これは64bit Amazon Linux 2014.09 v1.0.9 running Python 2.7

.ebextensions/01_pre_deps.config:

packages:
  yum:
    gcc-c++: []
    make: []
    openssl-devel: []
    git: []
    python-devel: []
    python27-devel: []
    ruby-devel: []
    postgresql93: []
    postgresql93-devel: []
    # nginx: []
  rubygems:
    bundler: '1.7.3'
    compass-core: '1.1.0.alpha.3'
    neat-compass: '1.6.0'
于 2014-11-20T23:32:33.293 に答える
1

mysql-develパッケージがインストールされていることを確認しましたか? yum設定ファイルのセクションに含まれていないよう です。

于 2013-11-13T10:45:57.737 に答える