Error sending bulk emails


We are facing a problem with email sends: if we try to enroll users with Instructor > Membership > Batch Enrollment no email is being send and it shows the following error: Error enrolling/unenrolling users.

Sometimes the following funcionalities fail to send emails:

  • Reset password
  • Forgot password
  • Activate account

While bulk enrollments fails constantly, the other funcionalities fail from time to time. We were able to reproduce it by overloading the MySQL container.

Sending emails through tutor local run --no-deps lms ./ lms shell -c "from django.core.mail import send_mail; send_mail('test subject', 'test message', '', ['']) works perfectly fine.

We tried to follow the error through the logs, but we were unable to track it.

This issue seem to affect to other users:

In our config.yml:

RUN_SMTP: false

And also in the lms settings:


Any help is welcome,
Thanks in advance

Have you tried other email hosts?
You could get blocked if you send too many emails in a short period of time (it depends on the host quota).

Just try Gmail to send some emails to see if it’s a problem with the email host.

Have you checked the lms-worker logs? (Don’t confuse the lms-worker with the uwsgi workers). Lms-workers handle the celery queues in background and in turn send emails.

Hi @Andres.Aulasneo @Anh_Vu_Nguy_n

Certainly there is something related with lms-worker / cms-worker connection. When it get stucked, neither lms-worker or cms-worker logs anything.

We were also having problems with other celery tasks as in this post Celery tasks are broken - Site Operators / Site Operations Help - Open edX discussions, so after cleaning up Redis caché the instructors tasks worked again and the issues with emails like password reset and user validation were fixed.

But we still have a problem with course inscription bulk emails. I have to check @Anh_Vu_Nguy_n proposal, I will post again afterwards

Thanks very much for your help