1👍
Yes, the path is ok:
command=/opt/python/run/venv/bin/celery worker -A wellfie --loglevel=INFO
I’ve notice that you have your PYTHONPATH variable set twice, like you would overwrite with eb environment property? Once it is set on application and then on application wellfie package.
Your log entry:
environment=
PYTHONPATH="/opt/python/current/app/:",
PATH="/opt/python/run/venv/bin/:%ENV_PATH)s",
RDS_PORT="5432",
PYTHONPATH="/opt/python/current/app/wellfie:",
REDIS_URL="bbbbb.bbbbb.0001.usw2.cache.amazonaws.com:6379",
RDS_DB_NAME="bbbdb",
DJANGO_SETTINGS_MODULE="wellfie.settings",
RDS_USERNAME="aaaa",
RDS_PASSWORD="bbbb",
RDS_HOSTNAME="bbbbb.bbbbb.us-west-2.rds.amazonaws.com"
My:
environment=
PYTHONPATH="/opt/python/current/app/:",
PATH="/opt/python/run/venv/bin/:%(ENV_PATH)s",
WEBSERVER="APACHE",
CNAME="xxxxx-prod-env",
PYCURL_SSL_LIBRARY="nss",
APP_ENV="prod"
So I would start with investigating that.
Another thing to have in mind is that if you use some AWS services like Redis, you need open connection on it with security group settings for that service, otherwise you will not be able to connect.
Things to have in mind:
-
If you play on the instance, remember about virtualenv. So you run you commands like:
cd /opt/python/current/app && source /opt/python/run/venv/bin/activate && python manage.py
-
“ImportError: No module named ‘wellfie'” may happen once, and be logged into celery-beat.log, celery-worker.log” since system is starting and process may not be ready yet.
-
ImportError(‘No module named xxxx.toi3pr.0001.usw2.cache.amazonaws.com’,) looks like python initialization issue.
Modify file root_folder/django_app/__init__.py:
from __future__ import absolute_import, unicode_literals
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from django_app.celery import app as celery_app
__all__ = ['celery_app']
Fix was to change:
supervisorctl -c /opt/python/etc/supervisord.conf restart celeryd
into
supervisorctl -c /opt/python/etc/supervisord.conf restart celeryd-worker
supervisorctl -c /opt/python/etc/supervisord.conf restart celeryd-beat