From 40a76330f6f238e5fd46f6b3bd37952f5ed35d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 22 Jun 2020 12:11:15 +0200 Subject: [PATCH] Fix unsent activation emails and other asynchronous tasks Half of the tasks from edx.lms.core.default celery queue were being processed by the CMS worker. Unfortunately, this CMS worker crashes on some of those tasks. For instance, activation emails complain of a missing "django_markup" template tag library because "xss_utils" is not part of the installed app in the CMS. The problem is that we need this edx.lms.core.default queue to be part of the CELERY_QUEUES in the cms in order to send tasks from the CMS to the LMS. The trick to resolve this situation is to ask the CMS celery worker to not process the tasks from this queue. To debug this issue, run in the LMS: from student.tasks import send_activation_email send_activation_email("{}") Then watch the logs of the lms and cms workers. If the CMS workers picks up this task (50% of the time prior to this change) then we have an issue. See: https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690 --- CHANGELOG.md | 4 ++++ tutor/templates/local/docker-compose.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8e7583..48c7149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Note: Breaking changes between versions are indicated by "💥". +## Unreleased + +- [Bugfix] Fix unsent activation emails and other asynchronous tasks + ## v10.0.5 (2020-06-21) - [Security] Apply edx-platform upstream xss security fixes ([pull request](https://github.com/edx/edx-platform/pull/24258)) diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index 456d96d..c0184a9 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -151,7 +151,7 @@ services: SERVICE_VARIANT: cms SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} C_FORCE_ROOT: "1" # run celery tasks as root #nofear - command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 + command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default restart: unless-stopped volumes: - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/