Django on AWS Elasticbeanstalk: Command 02_createadmin failed


I’m trying to deploy my first django application, and chose AWS with elastic beanstalk because it seemed like the most straightforward way to do so. I have been haltingly working through the (outdated) official docs, but am completely stuck trying to configure the admin site (step 7). I’ve also been using this blog post and the accompanying broilerplate code.
I’m using Python 2.7, Django 1.6.1, (locally) Windows 8 with Powershell.

When I try to deploy my application, I get the error:

[Instance: i-03f98f2d Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 02_createadmin failed.

Here’s what (I think) the relevant part of the logs looks like, I’d be happy to update with more if this isn’t enough:

My files:


/scripts/ (I’ve tried several versions of this, none of them seem to work):

Also tried:


What I’ve Tried:

  • Like the docs say, I run
    chmod +x scripts/
    I’ve been doing this every time I save the file to be safe, I don’t know if re-saving it overwrites the existing permissions.
    I also tried inserting another command into the .config file to do the same thing. I’m not sure if this is the problem, but there is that line
    2014-02-10 19:07:17,341 [DEBUG] Command 02_createadmin output: /bin/sh: scripts/ Permission denied
    in the logs.
  • I’ve seen a couple different versions of the line:
    “#!/usr/bin/env python” in my googling, and have tried changing it to “#!/usr/bin/env/python”, “#!/usr/bin/env/python2.7”, “#!/usr/bin/env python”, etc.
  • When developing the app locally, running “syncdb” and responding to the prompts sets up the admin user automatically. Is there some way to have command 01_syncdb take care of that for me?
  • When working through the tutorial, I actually did skip a step in the shell:
    alias eb=”python2.7 ../AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python2.7/eb”
    I couldn’t figure out the powershell equivalent of the command, and all of the “eb init” and “eb start” commands worked fine anyways without setting up the alias. I don’t think this is the issue, but I’m also not really sure what this line does.

I would just skip this step if I could, but I can’t figure out any other way to get access to the app’s database. I have been banging my head against this particular wall for about two days now, and would really appreciate any help. I can’t be the only one to have had this problem, but all the internet reveals to me is problems/solutions for commands 01_syncdb and 03_collectstatics. Any advice on how to get this setup to work, or (alternatively) get by without scripting the creation of the admin?


I’m running it exactly, and not getting any error. The filepath for the command looks like its coming from git, so I’m not sure if it’s doing the same thing as the bash chmod. Googling “powershell chmod” turns up a fairly complicated workaround, so I’ll try that. But when I use the GUI to look at the file’s permissions, SYSTEM, admin, and regular user (locally) all have all permissions for, so I’m not the permissions haven’t been set correctly, at least locally. I’ll try the powershell version of chmod, and then I guess ssh into the aws server (which I really don’t know how to do at the moment) and update with the results.


Leave a Reply