Closed Bug 900276 Opened 11 years ago Closed 11 years ago

[traceback] 500 Error: MultipleObjectsReturned: get() returned more than one Group -- it returned 2! Lookup parameters were {'url': u'badges'}

Categories

(Participation Infrastructure :: Phonebook, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrandt, Unassigned)

References

()

Details

(Whiteboard: [kb=1083524] [traceback])

Reproducible on prod, stage, and dev

Steps to reproduce:
0. goto https://mozillians.org/group/badges/

Actual:

Traceback (most recent call last):

  File "/data/www/mozillians.org/mozillians/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/hooks/framework_django.py", line 475, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/mozillians.org/mozillians/vendor/src/django/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians.org/mozillians/apps/groups/views.py", line 79, in show
    group = get_object_or_404(Group, url=url)

  File "/data/www/mozillians.org/mozillians/vendor/src/django/django/shortcuts/__init__.py", line 113, in get_object_or_404
    return queryset.get(*args, **kwargs)

  File "/data/www/mozillians.org/mozillians/vendor/src/django/django/db/models/query.py", line 368, in get
    % (self.model._meta.object_name, num, kwargs))

MultipleObjectsReturned: get() returned more than one Group -- it returned 2! Lookup parameters were {'url': u'badges'}
Not sure if this is related, but I believe the 'badges' group was merged with another group ('open-badges' if I remember correctly). This merge happened a couple months ago. Perhaps there's an issue with the group merge behavior?
Whiteboard: [traceback] → [kb=1083524] [traceback]
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/61a2f91fc33f86f0e942ebfabad89075c4035259
[bug 900276] Search group urls in admin panel.

https://github.com/mozilla/mozillians/commit/cf46708826e640d9b03a8182b7ec2b25acabd60e
Merge pull request #594 from glogiotatidis/900276

[bug 900276] Search group urls in admin panel.
The functional area group name 'open badges' had a url named 'badges' (instead of open-badges) probably altered manually a lot time ago. This manual change, which did not trigger the correct functions, allowed another group named 'badges' with the same url to be created.

I now merged the two groups and everything works as expected.

I don't believe the same issue can be reproduce now with another set of groups, because manual editing of group urls is disabled on the site.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Lovely! Thanks giorgos and williamr ... that did the trick. https://mozillians.org/en-US/group/badges is properly merged with open badges.

QA verified on prod
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.