Error registering users

Hi,

tutor version 20.0.0

When new users register, the platform doesn’t send the activation email. When I check the logs, I see the following error:

2025-07-30 19:47:11,636 INFO 14 [openedx_events.tooling] [user 780] [ip ] tooling.py:179 - Responses of the Open edX Event <org.openedx.learning.student.registration.completed.v1>:
lms-1  | []
lms-1  | 2025-07-30 19:47:11,639 ERROR 14 [edx.discussion] [user 780] [ip ] user.py:1226 - Could not create comments service user with id 780
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 189, in from_string
lms-1  |     namespace, rest = cls._separate_namespace(serialized)
lms-1  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 220, in _separate_namespace
lms-1  |     raise InvalidKeyError(cls, serialized)
lms-1  | opaque_keys.InvalidKeyError: <class 'opaque_keys.edx.keys.CourseKey'>: None
lms-1  |
lms-1  | During handling of the above exception, another exception occurred:
lms-1  |
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/edx-platform/common/djangoapps/student/models/user.py", line 1223, in create_comments_service_user
lms-1  |     cc_user.save()
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 170, in save
lms-1  |     response = self.handle_update(params)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 235, in handle_update
lms-1  |     response = self.handle_update_user(request_params, str(course_key))
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 248, in handle_update_user
lms-1  |     response = forum_api.update_user(
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/api/users.py", line 58, in update_user
lms-1  |     backend = get_backend(course_id)()
lms-1  |               ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/backend.py", line 35, in _get_backend
lms-1  |     if is_mysql_backend_enabled(course_id):
lms-1  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/backend.py", line 24, in is_mysql_backend_enabled
lms-1  |     course_key = CourseKey.from_string(course_id)
lms-1  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 198, in from_string
lms-1  |     return cls.deprecated_fallback._from_deprecated_string(serialized)  # type: ignore
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/edx/locator.py", line 403, in _from_deprecated_string
lms-1  |     raise InvalidKeyError(cls, serialized)
lms-1  | opaque_keys.InvalidKeyError: <class 'opaque_keys.edx.locator.CourseLocator'>: None

I have activated the forum plugin.

Has anyone else had the same thing happen to them and how did you resolve it?

I just performed a clean install and got the same error.

I’ve attached the list of commands used, and the Tutor version is 20.0.0.

   35  docker ps
   36  sudo curl -L "https://github.com/overhangio/tutor/releases/download/v20.0.0/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor
   37  sudo chmod 0755 /usr/local/bin/tutor
   38  _TUTOR_COMPLETE=bash_source tutor >> ~/.bashrc
   39  source .bashrc
   40  tutor local launch
   41  tutor plugins list
   42  tutor plugins enable forum
   43  tutor local launch -I
   44  tutor local logs -f --tail 10 lms

error log

lms-1  | 2025-07-30 22:49:41,506 INFO 14 [tracking] [user 4] [ip 192.168.88.114] logger.py:41 - {"name": "edx.user.settings.changed", "context": {"user_id": null, "path": "/api/user/v2/account/registration/", "course_id": "", "org_id": "", "enterprise_uuid": ""}, "username": "", "session": "f7c71a2a34342fa135aaf2aee883722c", "ip": "192.168.88.114", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36", "host": "dev.lan", "referer": "http://apps.dev.lan/", "accept_language": "es-MX,es;q=0.9", "event": {"old": null, "new": "es-419", "truncated": [], "setting": "pref-lang", "user_id": 4, "table": "user_api_userpreference"}, "time": "2025-07-30T22:49:41.506324+00:00", "event_type": "edx.user.settings.changed", "event_source": "server", "page": null}
lms-1  | 2025-07-30 22:49:41,567 INFO 14 [openedx_events.tooling] [user 4] [ip 192.168.88.114] tooling.py:179 - Responses of the Open edX Event <org.openedx.learning.student.registration.completed.v1>:
lms-1  | []
lms-1  | 2025-07-30 22:49:41,571 ERROR 14 [edx.discussion] [user 4] [ip 192.168.88.114] user.py:1226 - Could not create comments service user with id 4
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 189, in from_string
lms-1  |     namespace, rest = cls._separate_namespace(serialized)
lms-1  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 220, in _separate_namespace
lms-1  |     raise InvalidKeyError(cls, serialized)
lms-1  | opaque_keys.InvalidKeyError: <class 'opaque_keys.edx.keys.CourseKey'>: None
lms-1  |
lms-1  | During handling of the above exception, another exception occurred:
lms-1  |
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/edx-platform/common/djangoapps/student/models/user.py", line 1223, in create_comments_service_user
lms-1  |     cc_user.save()
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 170, in save
lms-1  |     response = self.handle_update(params)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 235, in handle_update
lms-1  |     response = self.handle_update_user(request_params, str(course_key))
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 248, in handle_update_user
lms-1  |     response = forum_api.update_user(
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/api/users.py", line 58, in update_user
lms-1  |     backend = get_backend(course_id)()
lms-1  |               ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/backend.py", line 35, in _get_backend
lms-1  |     if is_mysql_backend_enabled(course_id):
lms-1  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/forum/backend.py", line 24, in is_mysql_backend_enabled
lms-1  |     course_key = CourseKey.from_string(course_id)
lms-1  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/__init__.py", line 198, in from_string
lms-1  |     return cls.deprecated_fallback._from_deprecated_string(serialized)  # type: ignore
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/opaque_keys/edx/locator.py", line 403, in _from_deprecated_string
lms-1  |     raise InvalidKeyError(cls, serialized)
lms-1  | opaque_keys.InvalidKeyError: <class 'opaque_keys.edx.locator.CourseLocator'>: None
lms-1  | 2025-07-30 22:49:41,578 INFO 14 [audit] [user 4] [ip 192.168.88.114] register.py:295 - Login success on new account creation - neto

@tutor-maintainers tagging you because this is an early user of Tutor 20 and they can’t get email to work, wondering if there’s an issue we missed in testing. AFAIK we had email working fine on the Teak testing box.

@tutor-maintainers ping again (11 days later) on this issue.

Missed it. We will take a look and get back on this.

@Abdul_Rehman has looked into the issue. It is happening due to an error in openedx/forum. There is an old open PR to fix that; we have commented on the PR to speed up the review.

Hello,
Thank you very much for responding. I’ve already seen the fix in the forum repository, but now how do I create the new forum image with this version?

Among other things, I would first need a legal conset from my former employer @abstract-technology, because I might have touched a related issue internally at time of working that relate to this issue, or any other.

Hi @sbernesto

I was facing kind of the same issue with forums, when I was trying to access to an embedded discussion block that was into a unit, the platform showed the following alert:

Even though the error seems different from yours, internally the logs threw the same error.

Thus, I found the way to implement @Abdul_Rehman solution. openedx-forum is a requirement of edx-platform, so you I’d had to create a fork of both repos, create a new tag/release of openedx-forum integrating those changes and modify edx-platform requirements to point to that tag. In summary:

  1. Create a fork of edx-platform and clone it locally
  2. Create a fork of openedx-forum and clone it locally
  3. Check for the commit that fixes the issue: commit 1e5d7cf
  4. Check for the version of edx-platform in your tutor project
  5. Check for the version of opened-forum being used by your edx-platform version
  6. Git checkout your openedx-forum to the target version (point 5) and make a cherry-pick of the commit (point 3).
  7. Generate a commit, tag the openedx-forum to whatever name you want and push your changes to remote.
  8. Git checkout your edx-platform to the target version (point 4) and modify every openedx-forum dependency reference to the newly created tag (point 7) through direct git download and commit. Here’s my example.
  9. Generate a commit, new tag or branch of edx-platform and push.
  10. Modify EDX_PLATFORM_REPOSITORY and EDX_PLATFORM_VERSION in your config.yml to point to your newly created one
  11. Rebuild openedx image and reboot tutor

To test it you can go into the LMS and search for the changes in backend.py:

  1. run tutor local exec lms bash
  2. from inside the lms, run cat /openedx/venv/lib/python****/site-packages/forum/backend.py You should see the modification
  3. You can also find if requirements have been modified by grep -R openedx-forum /openedx/edx-platform/requirements/

Hope this will help you integrate a solution. You can skip some of these steps, f.e. if you decide to use a further openedx-forum or edx-platform version instead of a custom one, but just in case it can help to understand the problem

Regards

I’m also facing an issue with user registration.
The problem is that the platform reports multiple registration attempts for all users. Even if I restart the platform, the issue doesn’t go away.

The only solution I’ve found is clearing the Redis cache — and even that doesn’t always help. Does this mean I have to do this regularly from time to time? And how can I monitor or track this issue overall?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.