Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception handling oddity in third_party_auth #878

Open
deborahgu opened this issue Dec 18, 2024 · 0 comments
Open

exception handling oddity in third_party_auth #878

deborahgu opened this issue Dec 18, 2024 · 0 comments

Comments

@deborahgu
Copy link
Member

deborahgu commented Dec 18, 2024

The error pasted below was flagged for Aperture's attention (because it bubbled up to user_api). The error is happening when user_api calls third_party_auth's get_duplicate_provider method and fails an assertion check because it apparently receives more than one "is already in use" Exception from social-auth-app-django (exception definition in python-social auth). Per both our comment and their docs, we should never get two messages here.

This only happened in one span, and maybe there was a weird glitch in the caller? I don't see any evidence the same user had a successful session, or a successful login since. (They have no recent log history, but they've enrolled in multiple courses in the past.)

error link (2U-internal).

Stack trace:

builtins.AssertionError
Traceback (most recent call last):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.11/site-packages/ddtrace/contrib/trace_utils.py", line 336, in wrapper
    return func(mod, pin, wrapped, instance, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.11/site-packages/ddtrace/contrib/internal/django/patch.py", line 333, in wrapped
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.11/site-packages/django/views/decorators/http.py", line 43, in inner
    return func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/accounts/settings_views.py", line 65, in account_settings
    duplicate_provider = pipeline.get_duplicate_provider(messages.get_messages(request))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/edx/app/edxapp/edx-platform/common/djangoapps/third_party_auth/pipeline.py", line 439, in get_duplicate_provider
    assert len(social_auth_messages) == 1
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant