Marco Herrarte
Marco Herrarte

Reputation: 1620

Elastic Beanstalk with python 3.4 still using python 2.7

I just spin up some environment using EB with python 3.4 and Django but it keeps failing, looks like the error occurs when installing using pip install -r requirements.txt this are the events from the web console:

Time    Type    Details
2017-10-06 20:22:39 UTC-0600    WARN    Environment health has transitioned from Pending to Degraded. Command failed on all instances. Initialization completed 69 seconds ago and took 14 minutes.
2017-10-06 20:22:20 UTC-0600    ERROR   Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
2017-10-06 20:21:17 UTC-0600    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2017-10-06 20:21:17 UTC-0600    ERROR   [Instance: i-0b46caf0e3099458c] 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.
2017-10-06 20:21:14 UTC-0600    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.

I followed this tutorial: django-elastic-beanstalk-django and deploying-a-django-app-and-postgresql-to-aws-elastic-beanstalk on both I'm stuck at the same step

Upvotes: 4

Views: 1857

Answers (1)

Chris
Chris

Reputation: 29742

I had an exact same problem. Here is the solution I found:

  1. Go to your env's configuration
  2. Click the conf button of Instances
  3. Under Server section, check your Custom AMI ID

For now, leave the page and go to AWS EC2 Console page

  1. Press Launch Instance
  2. You will now be on Step 1: Choose an Amazon Machine Image (AMI)
  3. Tada! You will see these ami ids that you can choose from: AMI-IDs

  4. Go back to no.3 and fill up the Custom AMI ID, refer from no.6 (FYI, I used amazon linux, but it is up to you to decide)

  5. Click Apply and wait till the configuration is done
  6. Re-follow the deploying django app
  7. DONE!

Upvotes: 2

Related Questions