I've recently deployed my Django API backend to AWS EB to their Linux 2 system (exact platform name is Python 3.7 running on 64bit Amazon Linux 2
).
Almost everything is working as expected, but my application health status is Severe
and after hours of debugging I've no idea why.
The application's health check is being handled using the following endpoint (django-health-check
module).
url(r'^ht/', include('health_check.urls'))
100% of the requests have a status code of 200
but my overall health status is the following:
|--------------------|----------------|---------------------------------------------------|
| instance-id | status | cause |
|--------------------|----------------|---------------------------------------------------|
| Overall | Degraded | Impaired services on all instances. |
| i-0eb89f... | Severe | Following services are not running: release. |
|--------------------|----------------|---------------------------------------------------|
The strangest thing is the fact that the message Following services are not running: release.
is unique to the internet (seems like no one has had such problem before).
The other weird thing are the contents of my /var/log/healthd/daemon.log
file which are lines similar to
W, [2020-07-21T09:00:01.209091 #3467] WARN -- : log file "/var/log/nginx/healthd/application.log.2020-07-21-09" does not exist
where the time changes.
The last thing that may be relevant are the contents of my single file inside .ebextensions
directory:
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "app.settings"
"PYTHONPATH": "/var/app/current:$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: app.wsgi:application
NumProcesses: 3
NumThreads: 20
aws:elasticbeanstalk:environment:proxy:staticfiles:
/static: static
/static_files: static_files
container_commands:
01_migrate:
command: "source /var/app/venv/staging-LQM1lest/bin/activate && python manage.py migrate --noinput"
leader_only: true
packages:
yum:
git: []
postgresql-devel: []
Does anyone have any idea how can this be resolved? The ultimate goal is to have the green OK health.
EDIT: In the end I switched to the Basic
health system and the problems suddenly went away. I am however still interested in solving the original problem as the Enhanced
health system provides some benefits