I'm trying to deploy my application on AWS Elastic Beanstalk. I am getting this error and totally unable to see where the problem is.
The below is the code present in .ebextensions/mysite-env.config
packages:
yum:
python-devel: []
postgresql-devel: []
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02_createadmin:
command: "scripts/createadmin.py"
leader_only: true
option_settings:
- option_name: WSGIPath
namespace: "aws:elasticbeanstalk:container:python"
value: "mysite/wsgi.py"
- option_name: DJANGO_SETTINGS_MODULE
value: "mysite.settings"
After several hit-and-try methods, I figured out few things
- The above config file seems to run after
requirements.txt
present in root - Unable to install those packages (mentioned above) but I could get installed by getting into
ssh
of the EC2 instance (weird)
The issue with [1]
is that, for psycopg2
to install, I need the above mentioned packages. So, how do I install them first?
When I run these settings, I am getting the below error:
[2014-11-19T09:45:19.819Z] INFO [6703] - [CMD-AppDeploy/AppDeployStage0/EbExtensionPreBuild] : Activity execution failed, because: command failed with error code 1: Error occurred during build: Yum does not have postgresql-devel available for installation (Executor::NonZeroExitStatus)
Then, I used the below settings
packages: yum: python-devel: [] apt: postgresql-devel: []
Then I am getting the below error:
[2014-11-19T09:47:54.271Z] ERROR [6789] : Command execution failed: [CMD-AppDeploy/AppDeployStage0/EbExtensionPreBuild] command failed with error code 1: Error occurred during build: [Errno 2] No such file or directory (ElasticBeanstalk::ActivityFatalError)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.0/lib/elasticbeanstalk/activity.rb:189:in `rescue in exec'
...
caused by: command failed with error code 1: Error occurred during build: [Errno 2] No such file or directory (Executor::NonZeroExitStatus)
When I could install those packages directly from ssh
, whats the problem with automation? What's wrong with my settings?