Password reset crash with "multiple authentication backends" message

Bug #1770487 reported by Maximiliano Bertacchini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical SSO provider
Fix Released
Undecided
Maximiliano Bertacchini

Bug Description

SSO has logged a few instances of a crash during password reset POST, with message:

"You have multiple authentication backends configured and therefore must provide the `backend` argument or set the `backend` attribute on the user."

Haven't been able to reproduce, but looking closely at the code, it'll happen if *all* authentication backends (LaunchpadBackend, django's ModelBackend, OpenIDBackend) return `None` (verified locally by forcing a couple of `return None`). I suspect a rare combination of account+email states might be to blame (e.g. invalid, suspended, etc).

Backtrace:
ValueError: You have multiple authentication backends configured and therefore must provide the `backend` argument or set the `backend` attribute on the user.
  File "django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "webui/decorators.py", line 211, in wrapper
    return self.view_wrapper(request, fn, *args, **kwargs)
  File "webui/decorators.py", line 228, in view_wrapper
    return fn(request, *args, **kwargs)
  File "webui/views/ui.py", line 709, in reset_password
    auth.login(request, user)
  File "django/contrib/auth/__init__.py", line 150, in login
    'You have multiple authentication backends configured and '

Related branches

description: updated
description: updated
Changed in canonical-identity-provider:
status: New → In Progress
assignee: nobody → Maximiliano Bertacchini (maxiberta)
Changed in canonical-identity-provider:
status: In Progress → Fix Committed
Changed in canonical-identity-provider:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.