I have an EC2 instance set up through Beanstalk, but I cannot get the config to run migration
my .ebextension/django.config
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: my_app.settings
aws:elasticbeanstalk:container:python:
WSGIPath: my_app.wsgi:application
NumProcesses: 3
NumThreads: 20
container_commands:
00_test_output:
command: "echo 'testing.....'"
01_migrate:
command: "python manage.py migrate"
leader_only: true
After checking the logs, it says
Invalid HTTP_HOST header: '52.37.179.147'. You may need to add '52.37.179.147' to ALLOWED_HOSTS.
Invalid HTTP_HOST header: '172.31.0.249'. You may need to add '172.31.0.249' to ALLOWED_HOSTS.
Now even if I add these ip's to ALLOWED_HOSTS in my settings.py, the problem remains. I searched around here and found no answer to this specific issue
Without the migration commands, my server is built successfully and is running.
Anyone know why?
EDIT:
to add more info:
When I run eb deploy
after committing to my github, i got error as following
2020-06-03 03:45:10 ERROR [Instance: i-05f872f7e96ccd26d] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-06-03 03:45:11 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-06-03 03:45:11 ERROR Unsuccessful command execution on instance id(s) 'i-05f872f7e96ccd26d'. Aborting the operation.
2020-06-03 03:45:11 ERROR Failed to deploy application.
Then I go into web.stdout.log
to find those allowed_host errors. Then again, from another post, it doesn't seem like adding these ip's help since they are AWS ip's
I can't locate other error logs from cloudwatch. This seems like the only suspect
The eb-engine.log
only says
Error occurred during build: Command 01_migrate failed
so I knoe the echo
worked.....