Search code examples
djangomongodbdotcloud

dotcloud django mongo 502


I got a django app from https://github.com/jpetazzo/django-and-mongodb-on-dotcloud

but the app is gets a 502 - application not responding error.

while deploying the app, the waitfordb and manage throws authentication error. I sshed and ran these scripts individually all ran fine, but still the server throws 502 error.

Can someone give some pointers. I need to set up a django based app using mongodb


Solution

  • There was a recent change (bug fix) to the python service's master nginx.conf file. Originally it declared a nginx location block like this.

    location /static { root /home/dotcloud/data ; }
    

    which broke things, so it was changed to this.

    location /static/ { root /home/dotcloud/data ; }
    

    When this happend anyone who has declared their own /static/ location block in their own nginx.conf file will result in an nginx error, and it won't start. You can confirm this is your problem by sshing into your service.

    dotcloud ssh <application.service>
    

    And then looking at your nginx log files in /var/log/nginx/.

    The easiest way to fix this is to remove your /static/ location block from your nginx.conf file and then repush your application.

    The repo you are referring to above, hasn't been fixed yet.