rbbz should use AuthBackendHook

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: dkl, Unassigned)

Tracking

Development/Staging

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Even if the rbbz extension is installed but not enabled via the admin UI, it still shows Bugzilla as an auth method in the list of possible choices. If you choose Bugzilla and enter a proper XMLRPC endpoint, if you try to log in it will generate a fatal error that the 'bugzillausermap' table does not exist.

[Tue Jul 15 15:14:14 2014] [error] (1146, "Table 'reviewboard.rbbz_bugzillausermap' doesn't exist")
[Tue Jul 15 15:14:14 2014] [error] Traceback (most recent call last):
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/core/handlers/base.py", line 112, in get_response
[Tue Jul 15 15:14:14 2014] [error]     response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/views/decorators/debug.py", line 75, in sensitive_post_parameters_wrapper
[Tue Jul 15 15:14:14 2014] [error]     return view(request, *args, **kwargs)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/utils/decorators.py", line 99, in _wrapped_view
[Tue Jul 15 15:14:14 2014] [error]     response = view_func(request, *args, **kwargs)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func
[Tue Jul 15 15:14:14 2014] [error]     response = view_func(request, *args, **kwargs)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/contrib/auth/views.py", line 36, in login
[Tue Jul 15 15:14:14 2014] [error]     if form.is_valid():
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/forms/forms.py", line 129, in is_valid
[Tue Jul 15 15:14:14 2014] [error]     return self.is_bound and not bool(self.errors)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/forms/forms.py", line 121, in errors
[Tue Jul 15 15:14:14 2014] [error]     self.full_clean()
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/forms/forms.py", line 274, in full_clean
[Tue Jul 15 15:14:14 2014] [error]     self._clean_form()
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/forms/forms.py", line 300, in _clean_form
[Tue Jul 15 15:14:14 2014] [error]     self.cleaned_data = self.clean()
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/contrib/auth/forms.py", line 189, in clean
[Tue Jul 15 15:14:14 2014] [error]     password=password)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/contrib/auth/__init__.py", line 49, in authenticate
[Tue Jul 15 15:14:14 2014] [error]     user = backend.authenticate(**credentials)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/rbbz-0.1.16-py2.6.egg/rbbz/auth.py", line 49, in authenticate
[Tue Jul 15 15:14:14 2014] [error]     users = get_or_create_bugzilla_users(user_data)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/rbbz-0.1.16-py2.6.egg/rbbz/models.py", line 29, in get_or_create_bugzilla_users
[Tue Jul 15 15:14:14 2014] [error]     bugzilla_user_id=bz_user_id)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/manager.py", line 151, in get
[Tue Jul 15 15:14:14 2014] [error]     return self.get_queryset().get(*args, **kwargs)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/query.py", line 304, in get
[Tue Jul 15 15:14:14 2014] [error]     num = len(clone)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/query.py", line 77, in __len__
[Tue Jul 15 15:14:14 2014] [error]     self._fetch_all()
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/query.py", line 857, in _fetch_all
[Tue Jul 15 15:14:14 2014] [error]     self._result_cache = list(self.iterator())
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/query.py", line 220, in iterator
[Tue Jul 15 15:14:14 2014] [error]     for row in compiler.results_iter():
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/sql/compiler.py", line 713, in results_iter
[Tue Jul 15 15:14:14 2014] [error]     for rows in self.execute_sql(MULTI):
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/models/sql/compiler.py", line 786, in execute_sql
[Tue Jul 15 15:14:14 2014] [error]     cursor.execute(sql, params)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/backends/util.py", line 53, in execute
[Tue Jul 15 15:14:14 2014] [error]     return self.cursor.execute(sql, params)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/utils.py", line 99, in __exit__
[Tue Jul 15 15:14:14 2014] [error]     six.reraise(dj_exc_type, dj_exc_value, traceback)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/backends/util.py", line 53, in execute
[Tue Jul 15 15:14:14 2014] [error]     return self.cursor.execute(sql, params)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib/python2.6/site-packages/Django-1.6.5-py2.6.egg/django/db/backends/mysql/base.py", line 124, in execute
[Tue Jul 15 15:14:14 2014] [error]     return self.cursor.execute(query, args)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
[Tue Jul 15 15:14:14 2014] [error]     self.errorhandler(self, exc, value)
[Tue Jul 15 15:14:14 2014] [error]   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
[Tue Jul 15 15:14:14 2014] [error]     raise errorclass, errorvalue
[Tue Jul 15 15:14:14 2014] [error] ProgrammingError: (1146, "Table 'reviewboard.rbbz_bugzillausermap' doesn't exist")

Comment 1

4 years ago
I believe the problem is that we aren't using an AuthBackendHook to load the backend: https://www.reviewboard.org/docs/manual/2.0/extending/extensions/hooks/auth-backend-hook/#auth-backend-hook
Summary: rbbz extension should disable Bugzilla as an authentication method choice if the rbbz extension is not enabled for the current instance → rbbz should use AuthBackendHook
(Reporter)

Updated

4 years ago
Version: Production → Development/Staging

Comment 2

4 years ago
Created attachment 8456594 [details]
Review for review ID: bz://1038731

/r/72 - Bug 1038731 - Switch auth backend from entry point to extension.
Attachment #8456594 - Flags: review?(dkl)
(Reporter)

Comment 3

4 years ago
Comment on attachment 8456594 [details]
Review for review ID: bz://1038731

Fixes the issue and works as expected. r=dkl
Attachment #8456594 - Flags: review?(dkl) → review+
(Reporter)

Comment 4

4 years ago
Fixes issue and works as expected. r=dkl
(Reporter)

Updated

4 years ago
Attachment #8456594 - Flags: review+

Comment 5

4 years ago
http://hg.mozilla.org/hgcustom/version-control-tools/rev/2b8d2b708929
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Product: bugzilla.mozilla.org → Developer Services
(Assignee)

Updated

3 years ago
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.