1

[Instance: i-*****************] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

i'm getting this error, can anyone give some picture of what and why it is coming.

And my requirements.txt is

Django==1.11.4, djangorestframework==3.5.1, psycopg2==2.7.3.1, gunicorn==19.7.0, django-cors-headers==2.1.0, whitenoise==3.3.1, coreapi==2.3.1, sendgrid==5.2.0, awsebcli==3.5.1, pystan==2.17.0.0

Sakthi Panneerselvam
  • 1,337
  • 1
  • 14
  • 25

1 Answers1

2

Your requirements.txt should look like this:

Django==1.11.4
djangorestframework==3.5.1
psycopg2==2.7.3.1
gunicorn==19.7.0
django-cors-headers==2.1.0
whitenoise==3.3.1
coreapi==2.3.1
sendgrid==5.2.0
awsebcli==3.5.1
pystan==2.17.0.0

if you connect to your instance using

eb ssh

And then run

source /opt/python/run/venv/bin/activate
source /opt/python/current/env
pip install -r /opt/python/current/app/requirements.txt

You should get to see the errors.

Tom.

Tom
  • 172
  • 6
  • corrupted means ? – Sakthi Panneerselvam Nov 03 '17 at 10:56
  • please see above – Tom Nov 03 '17 at 11:19
  • Same as in my project but i copy pasted like this. – Sakthi Panneerselvam Nov 03 '17 at 11:22
  • are you installing the necessary prerequesitites using yum? Take a look at the example ebextensions file here: https://stackoverflow.com/questions/47064290/issue-deploying-django-to-aws/47065045#47065045 – Tom Nov 03 '17 at 11:39
  • only postgres is installing using yum. And this is my .config file ``container_commands: 01_migrate: command: "python manage.py migrate" leader_only: true 02_collectstatic: command: "python manage.py collectstatic --noinput" option_settings: "aws:elasticbeanstalk:application:environment": DJANGO_SETTINGS_MODULE: "pms_backend.settings" PYTHONPATH: "$PYTHONPATH" "aws:elasticbeanstalk:container:python": WSGIPath: "pms_backend/wsgi.py" packages: yum: postgresql95-devel: [] `` – Sakthi Panneerselvam Nov 03 '17 at 12:13
  • please try adding the other yum packages from https://stackoverflow.com/questions/47064290/issue-deploying-django-to-aws/47065045#47065045 – Tom Nov 03 '17 at 12:18
  • pip can install this in virtual environment, why yum? – Sakthi Panneerselvam Nov 03 '17 at 12:20
  • not everything can be installed by pip in elastic beanstalk unfortunately – Tom Nov 03 '17 at 12:22
  • Tried, error coming.``CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. `` – Sakthi Panneerselvam Nov 03 '17 at 12:25
  • please see above – Tom Nov 03 '17 at 12:30
  • Problem with the pip version, trying to upgrade that it throws permission denied error and i'm not able to use sudo & not able to change the folder permission. – Sakthi Panneerselvam Nov 03 '17 at 13:04