AttributeError: 'AnonymousUser' object has no attribute 'backend'



7 years ago
7 years ago


(Reporter: retornam, Assigned: ozten)






7 years ago
Traceback (most recent call last):

  File "/data/www/", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/", line 107, in wrapper
    response = f(request, *args, **kw)

  File "/data/www/", line 41, in register
    uniq_id = _save_new_user(request, form)

  File "/data/www/", line 136, in _save_new_user
    auth.login(request, user)

  File "/data/www/", line 73, in login
    request.session[BACKEND_SESSION_KEY] = user.backend

  File "/data/www/", line 173, in inner
    return func(self._wrapped, *args)

AttributeError: 'AnonymousUser' object has no attribute 'backend'
Raymond, how are you hitting this bug?

Comment 2

7 years ago
(In reply to Aakash Desai [:aakashd] from comment #1)
> Raymond, how are you hitting this bug?

I wasn't the one who produced this bug, I filed this bug from the traceback emails

Comment 3

7 years ago
Aside: Without steps to reproduce, these bugs aren't going to get fixed very quickly.

Registering a new user on stage causes this stack trace. (Not on dev, because of a different issue).

Steps to Reproduce:
1) Clear cookies
2) Click Join Us
3) Fill in form and submit

Edit profile

500, stacktrace in Comment:0.

Comment 4

7 years ago
This reproduces in -dev now that bug#688199 is stubbed out.

Comment 5

7 years ago
Forgot the obvious - Does not repro on my local machine :(

Asked @jason to clear pyc files from -dev and stage.
Assignee: nobody → ozten.bugs

Comment 6

7 years ago
If I hardcode the wrong password[1] into authentication, this is reproducible.

This is a password issue like Bug#688121. Could this be an issue with backend datastore?


Comment 8

7 years ago
This is on -dev now. Results in expected

Exception: Authentication for new user [] with password len 8 failed

So... why isn't django_auth_ldap.backend.LDAPBackend able to authenticate the user?

Could be a replication issue...
Could be an ACL issue...

Comment 9

7 years ago exists and I can login with the same password.

login and register ultimately use the same codepath, so that rules out a ACL issue.


7 years ago
Duplicate of this bug: 688280

Comment 11

7 years ago
Another traceback that can be caused by these STR

Traceback (most recent call last):

  File "/data/www/", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/", line 106, in edit_new_profile
    return _edit_profile(request, unique_id, True)

  File "/data/www/", line 111, in _edit_profile
    person = ldap.get_by_unique_id(unique_id)

  File "/data/www/", line 180, in get_by_unique_id
    raise NO_SUCH_PERSON(msg % unique_id)

NO_SUCH_PERSON: Unable to locale 5c8e38e911 in the LDAP directory

So here we failed to create the user, we silently fail auth, then are redirected to the reg edit profile page, which fails since the user doesn't exist. Filed Bug#688476 to deploy latest to stage... which shouldn't allow this silent auth failure.

Comment 12

7 years ago
This no longer reproduces with stage config fixed in Bug#688204.
Last Resolved: 7 years ago
Resolution: --- → INVALID
Verified registering user works.
Component: → Phonebook
Product: Websites → Community Tools
QA Contact: mozillians-org → phonebook
Version: unspecified → other
You need to log in before you can comment on or make changes to this bug.