4

I'm trying to deploy this repo to Elastic Beanstalk: https://github.com/jordanmessina/test_beanstalk/tree/5e9a919d991adf22bce1a9b8f6c1515e83b1babb with this configuration: 64bit Amazon Linux 2014.09 v1.0.9 running Python 2.7

I'm getting the following error on deployment:

ERROR: [Instance: i-2eb19dc2 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: [CMD-AppDeploy/AppDeployStage0/EbExtensionPostBuild] command failed with error code 1: Error occurred during build: Command 01_syncdb failed.

When I go to the webpage after deployment, all I see is: Index of /

Is there something wrong with my configuration file?

UPDATE

I made some changes and managed to get the app running and 500ing (progress).

I've poked around on the instances the code is deployed to. I've narrowed the issue down to the mod_wsgi pythonpath that's setup. Here's the configuration:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/python/run/baselinenv
WSGISocketPrefix run/wsgi
WSGIRestrictEmbedded On

<VirtualHost *:80>

Alias /static/ /opt/python/current/app/static/
<Directory /opt/python/current/app/static/>
Order allow,deny
Allow from all
</Directory>


WSGIScriptAlias / /opt/python/current/app/webapp/beanstalk/wsgi.py


<Directory /opt/python/current/app/>
  Require all granted
</Directory>

WSGIDaemonProcess wsgi processes=1 threads=15 display-name=%{GROUP} \
  python-path=/opt/python/current/app:/opt/python/run/venv/lib/python2.7/site-packages user=wsgi group=wsgi \
  home=/opt/python/current/app
WSGIProcessGroup wsgi
</VirtualHost>

I also found the logs for the httpd process (standard /var/log/httpd/error_log for future reference) and was tailing them to see what the issue was. The problem was an ImportError with beanstalk.settings (because it's not on the path).

Now I'm trying to think of a sane way to keep my app structure (webapp directory in the root containing my django app) and update the python path for mod_wsgi so this thing works...I'm very frustrated with the opinionated app structure that Elastic Beanstalk is trying to push on me. Any suggestions would be great!

Jordan Messina
  • 1,511
  • 1
  • 16
  • 25

1 Answers1

1

You can't have the DB locally on elastic beanstalk as you are attempting. EB is meant just as an application container, what you have there will try and setup SQLite on the system, which beanstalk isn't gonna let you do.

You need to configure Django to point to some DB off the beanstalk, there is no DB on that instance and your Django config doesn't seem to have any DB configured on it as you seem to just be trying to use the included SQLite DB, which I'd imagine they don't let you install that on beanstalk, so why not try configuring an another DB or using no DB at all, if possible.

I'd spin up a small RDS instance and configure my Django app to tie into that. That should allow you to sync the DB and get started. It also might be a matter of SQLite not being on the system, so you'd have to configure EB to install that if it's even possible.

Stephen Carman
  • 999
  • 7
  • 25
  • I'm using a single instance, and it will let you create it. I don't care about persisting it, I just want the app working. I've narrowed it down to the pythonpath that's used for the mod_wsgi configuration. Updating question now. – Jordan Messina Jan 07 '15 at 20:33
  • @JordanMessina : Hey, 'm facing the same issue..but I'm too much of a noob here to figure out what change do I have to make wrt mod_wsgi. Could you please help... how do I change the python path on aws? – vivekanon Jan 17 '15 at 15:39
  • You may want to have a look here... https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.RDS.html#rds-external-defaultvpc – Josh Dec 18 '19 at 06:45