I have a test user account which was previously set up a long time ago (perhaps Lilac?), and which has a username that’s only 2 characters long: “aa”.
I recently saw on Palm that this user can’t sign in by their username! (email still works, and I usually sign in by email not username, so this is the first time I’ve seen this error.)
Mysteriously, only this test user is also having an error trying to view discussion pages:
I see an error of openedx.core.djangoapps.django_comment_common.comment_client.utils.CommentClientRequestError: ["Username is already taken"]
(full error below).
Is the discussion error related to the login error, and are they both due to not supporting short usernames anymore?
Full error when test user aa tries to post to forums:
lms-1 | 2024-05-08 14:06:39,905 INFO 6 [openedx.core.djangoapps.django_comment_common.comment_client.utils] [user 11] [ip 123.123.123.123] utils.py:82 - Investigation Log: CommentClientRequestError for request with put and params {'request_id': UUID('150117e6-b4c5-4294-b872-97de9e27c38f')}
lms-1 | 2024-05-08 14:06:39,907 ERROR 6 [root] [user None] [ip None] signals.py:22 - Uncaught exception from None
lms-1 | Traceback (most recent call last):
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/user.py", line 152, in _retrieve
lms-1 | response = utils.perform_request(
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/utils.py", line 83, in perform_request
lms-1 | raise CommentClientRequestError(response.text, response.status_code)
lms-1 | openedx.core.djangoapps.django_comment_common.comment_client.utils.CommentClientRequestError
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/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
lms-1 | response = get_response(request)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
lms-1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms-1 | File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
lms-1 | return func(*args, **kwds)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
lms-1 | return view_func(*args, **kwargs)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/viewsets.py", line 125, in view
lms-1 | return self.dispatch(request, *args, **kwargs)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
lms-1 | response = self.handle_exception(exc)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
lms-1 | response = handler(request, *args, **kwargs)
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/views.py", line 637, in create
lms-1 | return Response(create_thread(request, request.data))
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/api.py", line 1438, in create_thread
lms-1 | context = get_context(course, request)
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/serializers.py", line 70, in get_context
lms-1 | cc_requester = CommentClientUser.from_django_user(requester).retrieve()
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 67, in retrieve
lms-1 | self._retrieve(*args, **kwargs)
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/user.py", line 163, in _retrieve
lms-1 | self.save()
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 158, in save
lms-1 | response = perform_request(
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/utils.py", line 83, in perform_request
lms-1 | raise CommentClientRequestError(response.text, response.status_code)
lms-1 | openedx.core.djangoapps.django_comment_common.comment_client.utils.CommentClientRequestError: ["Username is already taken"]
lms-1 | 2024-05-08 14:06:39,942 ERROR 6 [django.request] [user 11] [ip 123.123.123.123] log.py:224 - Internal Server Error: /api/discussion/v1/threads/
lms-1 | Traceback (most recent call last):
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/user.py", line 152, in _retrieve
lms-1 | response = utils.perform_request(
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/utils.py", line 83, in perform_request
lms-1 | raise CommentClientRequestError(response.text, response.status_code)
lms-1 | openedx.core.djangoapps.django_comment_common.comment_client.utils.CommentClientRequestError
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/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
lms-1 | response = get_response(request)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
lms-1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms-1 | File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
lms-1 | return func(*args, **kwds)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
lms-1 | return view_func(*args, **kwargs)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/viewsets.py", line 125, in view
lms-1 | return self.dispatch(request, *args, **kwargs)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
lms-1 | response = self.handle_exception(exc)
lms-1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
lms-1 | response = handler(request, *args, **kwargs)
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/views.py", line 637, in create
lms-1 | return Response(create_thread(request, request.data))
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/api.py", line 1438, in create_thread
lms-1 | context = get_context(course, request)
lms-1 | File "/openedx/edx-platform/./lms/djangoapps/discussion/rest_api/serializers.py", line 70, in get_context
lms-1 | cc_requester = CommentClientUser.from_django_user(requester).retrieve()
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 67, in retrieve
lms-1 | self._retrieve(*args, **kwargs)
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/user.py", line 163, in _retrieve
lms-1 | self.save()
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/models.py", line 158, in save
lms-1 | response = perform_request(
lms-1 | File "/openedx/edx-platform/./openedx/core/djangoapps/django_comment_common/comment_client/utils.py", line 83, in perform_request
lms-1 | raise CommentClientRequestError(response.text, response.status_code)
lms-1 | openedx.core.djangoapps.django_comment_common.comment_client.utils.CommentClientRequestError: ["Username is already taken"]
lms-1 | [pid: 6|app: 0|req: 23/69] 172.18.0.3 () {62 vars in 3256 bytes} [Wed May 8 14:06:39 2024] POST /api/discussion/v1/threads/ => generated 9831 bytes in 234 msecs (HTTP/1.1 500) 9 headers in 617 bytes (1 switches on core 0)