After initially implementing Celery in my project, it was working fine. However, after adding SSL to the project, Celery has stopped functioning, and emails are not being sent.The other functionalities in my project are sending emails successfully, but the emails triggered by Celery tasks are not being sent.
the below is the output that means celery running in background properly.
root@django-project:/myprojects# source projectenv/bin/activate
(projectenv) root@django-project:/myprojects# cd ..
(projectenv) root@django-project:/# sudo supervisorctl stop celery_worker
celery_worker: stopped
(projectenv) root@django-project:/# sudo supervisorctl stop celery_beat
celery_beat: stopped
(projectenv) root@django-project:/# sudo supervisorctl restart celery_worker
celery_worker: ERROR (not running)
celery_worker: started
(projectenv) root@django-project:/# sudo supervisorctl restart celery_beat
celery_beat: ERROR (not running)
celery_beat: started
(projectenv) root@django-project:/# sudo supervisorctl status celery_worker
celery_worker RUNNING pid 353104, uptime 0:00:27
(projectenv) root@django-project:/# sudo supervisorctl status celery_beat
celery_beat RUNNING pid 353113, uptime 0:00:25
(projectenv) root@django-project:/#
the below is celery_beat.conf file
[program:celery_beat]
command=/myprojects/projectenv/bin/celery -A core beat -l info
directory=/myprojects/green_bill
user=root
autostart=true
autorestart=true
stderr_logfile=/var/log/celery_beat.err.log
stdout_logfile=/var/log/celery_beat.out.log
environment=PATH="/myprojects/projectenv/bin:%(ENV_PATH)s"
the below is celery_worker.conf file
[program:celery_worker]
command=/myprojects/projectenv/bin/celery -A core.celery worker --pool=solo -l info
directory=/myprojects/green_bill
user=root
autostart=true
autorestart=true
stderr_logfile=/var/log/celery_worker.err.log
stdout_logfile=/var/log/celery_worker.out.log
environment=PATH="/myprojects/projectenv/bin:%(ENV_PATH)s"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @rashmijoshi,
It’s hard to pinpoint the exact reason like that so here are some steps you can try to further troubleshoot the issue.
1. Check Celery Configuration
EMAIL_USE_TLS
orEMAIL_USE_SSL
), and valid SMTP server credentials.2. Review Logs
/var/log/celery_worker.err.log
and/var/log/celery_beat.err.log
) for any errors or warnings that occurred during the task execution, especially those related to email sending or SSL issues.3. Examine Network Configuration
4. Test Email Functionality Independently