Ranmal Mendis
Ranmal Mendis

Reputation: 141

Troubleshooting AWS Elastic Beanstalk Deployment Errors with Django Applications - Error: EbExtension build failed

When I was trying to deploy my Django application to AWS Elastic Beanstalk. Then I got this error.

2023/12/30 21:26:42.478526 [ERROR] An error occurred during the execution of command [app-deploy] - [PreBuildEbExtension]. Stop running the command. Error: EbExtension build failed. Please refer to /var/log/cfn-init.log for more details.

What is the reason for that?

Here is my Django.config which is located in .ebextensions folder.

When I remove the 'commands' it gives me 502 bad gateway since the application cannot import the relavant packages.

commands:
  01_activate_virtualenv:
    command: "source /var/app/venv/staging-LQM1lest/bin/activate"
  02_install_requirements:
    command: "pip install -r /var/app/current/requirements.txt"

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: django-pixel/core/wsgi.py

enter image description here

Upvotes: 0

Views: 297

Answers (1)

darkinsyde
darkinsyde

Reputation: 256

Elastic Beanstalks keeps many log files for every stages of the deployment. If you got any error from .ebextensions folder, you need to check cfn-init.log. As the error message said:

Please refer to /var/log/cfn-init.log for more details. 

You need to ssh into your eb instance and write down: cat /var/log/cfn-init.log to view it. For more details look cfn-init-cmd.log.

Upvotes: 0

Related Questions