1

While I was deploying Django Project to AWS Elastic Beanstalk, I received the following error. Everything works fine on localhost though.

Creating application version archive "app-160505_232739".
Uploading: [##################################################] 100% Done...
INFO: Environment update is starting.                               
INFO: Deploying new version to instance(s).                         
ERROR: [Instance: i-c5493f58] Command failed on instance. Return code: 1 Output: (TRUNCATED)..., level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'storages'. 
container_command 01_migrate in .ebextensions/03_python.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-c5493f58'. Aborting the operation.
ERROR: Failed to deploy application.      

.ebextensions/03_python.config file:

01_migrate:
    command: "python mooove_eb/manage.py migrate --noinput"
    leader_only: true
02_collectstatic:
    command: "python mooove_eb/manage.py collectstatic --noinput"
    leader_only: true    
0

1 Answer 1

1

The error message tells that you are missing the storages module. From AWS Elastic Beanstalk documentation:

Elastic Beanstalk uses to requirements.txt to determine which package to install on the EC2 instances that run your application.

You need to create a file named requirements.txt and add the line

storages==<your storages version>

You can run pip freeze to see the version you are using on your development environment.

Sign up to request clarification or add additional context in comments.

2 Comments

Agreed. Django is failing to bootstrap while trying to run the migrate command.
I had to run pip freeze > requirements.txt once with virtualenv on and once virtualenv off and combined them together. It worked!! Thanks for the help!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.