[Django]-Invalid requirements.txt on deploying django app to aws beanstalk

17πŸ‘

βœ…

I had the exact same problem. The only thing that worked for me was (automatically) rebuilding my entire environment. You can do that in the AWS console. Go to your environment and click Actions > Rebuild Environment. This will take some time, afterwards it will automatically relaunch your app without this error.

Update:

The problem keeps returning so now and then. I figured out that something is going wrong when pip compiles psycopg, which is needed for postgreSQL support. Haven’t found a real solution yet.

πŸ‘€JacobF

13πŸ‘

I was able to make this work by adding postgresql93-devel and postgresql93 to my .ebextensions

as described in Customizing the Software on EC2 Instances Running Linux

This is working for 64bit Amazon Linux 2014.09 v1.0.9 running Python 2.7

in .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'
πŸ‘€yolk

2πŸ‘

Although a different scenario than described by the OP, it may be of use to someone:

We got the same ERROR Your requirements.txt is invalid. Snapshot your logs for details. message while trying to deploy a minimal test app to a newly created t1.micro instance on Elastic Beanstalk.

The test app consisted of the basic AWS Python sample app (from here), to which we added the .ebextensions/software.config and requirements.txt from our production environment. The sole purpose was to test these two files in deployment.

Closer inspection of the logs uncovered a MemoryError during pip install. After upgrading to a t2.small instance, the deployment succeeded without issue.

πŸ‘€djvg

1πŸ‘

Have you made sure mysql-devel package is installed? It doesn’t seem to be included in the yum section of your config file.

πŸ‘€Anas

0πŸ‘

For whatever reason AWS wouldn’t install postgresql-devel packets from my .extensions/01_packets.config as yolk suggested. So instead I had to add

container_commands:
  01_addPostgreSQLPacket:
    command: 'yum install postgresql95-devel'
    leader_only: true

to my 02_django.config. After That it worked just fine.

πŸ‘€TheSeeker

Leave a comment