OAuth issues after SMTP config edits & tutor/lms restart


I have issues with django user authentication after editing my config.yml and restarting a bunch of times, and so now it hangs on login. I lost something.

Error on login is:

  • OAuth Client for the Login service, ‘login-service-client-id’, is not configured.

All I did was edit config.yml and start and restart a bunch of times, trying to get SMTP to work with FastMail (it’s still not working, but that’s a different story).

Here’s the relevant bit of log:

No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won’t be applied.
Run ‘manage.py makemigrations’ to make new migrations, and then re-run ‘manage.py migrate’ to apply them.
Traceback (most recent call last):
File “./manage.py”, line 123, in
execute_from_command_line([sys.argv[0]] + django_args)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/init.py”, line 375, in execute
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/openedx/edx-platform/openedx/core/djangoapps/oauth_dispatch/management/commands/create_dot_application.py”, line 137, in handle
user = User.objects.get(username=username)
File “/openedx/venv/lib/python3.8/site-packages/django/db/models/manager.py”, line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File “/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py”, line 406, in get
raise self.model.DoesNotExist(
django.contrib.auth.models.DoesNotExist: User matching query does not exist.

lms log:

2021-02-16 23:48:48,275 INFO 7 [audit] [user 5] [ip] models.py:2478 - Login success - user.id: 5
lms_1 | 2021-02-16 23:48:48,385 ERROR 7 [edx.student] [user 5] [ip] login.py:508 - {‘success’: False, ‘value’: Markup(‘OAuth Client for the Login service, ‘login-service-client-id’, is not configured.’)}
lms_1 | Traceback (most recent call last):
lms_1 | File “./openedx/core/djangoapps/user_authn/cookies.py”, line 318, in _get_login_oauth_client
lms_1 | return Application.objects.get(client_id=login_client_id)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/db/models/manager.py”, line 82, in manager_method
lms_1 | return getattr(self.get_queryset(), name)(*args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py”, line 406, in get
lms_1 | raise self.model.DoesNotExist(
lms_1 | oauth2_provider.models.Application.DoesNotExist: Application matching query does not exist.
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/core/djangoapps/user_authn/views/login.py”, line 501, in login_user
lms_1 | response = set_logged_in_cookies(request, response, possibly_authenticated_user)
lms_1 | File “./openedx/core/djangoapps/user_authn/cookies.py”, line 150, in set_logged_in_cookies
lms_1 | _create_and_set_jwt_cookies(response, request, cookie_settings, user=user)
lms_1 | File “./openedx/core/djangoapps/user_authn/cookies.py”, line 259, in _create_and_set_jwt_cookies
lms_1 | jwt = _create_jwt(request, user, expires_in)
lms_1 | File “./openedx/core/djangoapps/user_authn/cookies.py”, line 274, in _create_jwt
lms_1 | oauth_application = _get_login_oauth_client()
lms_1 | File “./openedx/core/djangoapps/user_authn/cookies.py”, line 320, in _get_login_oauth_client
lms_1 | raise AuthFailedError(
lms_1 | openedx.core.djangoapps.user_authn.exceptions.AuthFailedError

By the way, may I suggest a change in the documentation with respect to editing config.yml: possibly add an example in the documentation, including the stop-restart process, too? The order of operations isn’t entirely clear from the documentation (precisely, what am I stopping, do I only have to stop a specific process, or may I restart one process, etc.)

Hi @pmodv

Did you checked this previous thread Upgrading to Juniper fails with 'User matching query does not exist' - #9 by shashi.kiran, it might solve your problem.