MozillaSecurity / MozillaSecurity/FuzzManager
[Collector][CrashManager] MultipleObjectsReturned: get() returned more than one Product -- it returned 2!
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 208
- Forks
- 48
- Avg merge
- 23h 5m
- Merged PRs (30d)
- 2
Description
[Mon Oct 30 05:10:56.021729 2017] [wsgi:error] [pid 12:tid 140702473750272] Internal Server Error: /crashmanager/rest/crashes/
[Mon Oct 30 05:10:56.021740 2017] [wsgi:error] [pid 12:tid 140702473750272] Traceback (most recent call last):
[Mon Oct 30 05:10:56.021747 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
[Mon Oct 30 05:10:56.021753 2017] [wsgi:error] [pid 12:tid 140702473750272] response = get_response(request)
[Mon Oct 30 05:10:56.021768 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
[Mon Oct 30 05:10:56.021775 2017] [wsgi:error] [pid 12:tid 140702473750272] response = self._get_response(request)
[Mon Oct 30 05:10:56.021783 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response
[Mon Oct 30 05:10:56.021790 2017] [wsgi:error] [pid 12:tid 140702473750272] response = self.process_exception_by_middleware(e, request)
[Mon Oct 30 05:10:56.021797 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
[Mon Oct 30 05:10:56.021805 2017] [wsgi:error] [pid 12:tid 140702473750272] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Mon Oct 30 05:10:56.021812 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
[Mon Oct 30 05:10:56.021818 2017] [wsgi:error] [pid 12:tid 140702473750272] return view_func(*args, **kwargs)
[Mon Oct 30 05:10:56.021824 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 90, in view
[Mon Oct 30 05:10:56.021830 2017] [wsgi:error] [pid 12:tid 140702473750272] return self.dispatch(request, *args, **kwargs)
[Mon Oct 30 05:10:56.021841 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 489, in dispatch
[Mon Oct 30 05:10:56.021847 2017] [wsgi:error] [pid 12:tid 140702473750272] response = self.handle_exception(exc)
[Mon Oct 30 05:10:56.021853 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 449, in handle_exception
[Mon Oct 30 05:10:56.021859 2017] [wsgi:error] [pid 12:tid 140702473750272] self.raise_uncaught_exception(exc)
[Mon Oct 30 05:10:56.021865 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 486, in dispatch
[Mon Oct 30 05:10:56.021871 2017] [wsgi:error] [pid 12:tid 140702473750272] response = handler(request, *args, **kwargs)
[Mon Oct 30 05:10:56.021877 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/mixins.py", line 21, in create
[Mon Oct 30 05:10:56.021885 2017] [wsgi:error] [pid 12:tid 140702473750272] self.perform_create(serializer)
[Mon Oct 30 05:10:56.021892 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/mixins.py", line 26, in perform_create
[Mon Oct 30 05:10:56.021899 2017] [wsgi:error] [pid 12:tid 140702473750272] serializer.save()
[Mon Oct 30 05:10:56.021905 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 215, in save
[Mon Oct 30 05:10:56.021918 2017] [wsgi:error] [pid 12:tid 140702473750272] self.instance = self.create(validated_data)
[Mon Oct 30 05:10:56.021925 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/web/server/crashmanager/serializers.py", line 53, in create
[Mon Oct 30 05:10:56.021933 2017] [wsgi:error] [pid 12:tid 140702473750272] attrs['product'] = Product.objects.get_or_create(**attrs['product'])[0]
[Mon Oct 30 05:10:56.021939 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 85, in manager_method
[Mon Oct 30 05:10:56.021946 2017] [wsgi:error] [pid 12:tid 140702473750272] return getattr(self.get_queryset(), name)(*args, **kwargs)
[Mon Oct 30 05:10:56.021952 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 464, in get_or_create
[Mon Oct 30 05:10:56.021958 2017] [wsgi:error] [pid 12:tid 140702473750272] return self.get(**lookup), False
[Mon Oct 30 05:10:56.021964 2017] [wsgi:error] [pid 12:tid 140702473750272] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 384, in get
[Mon Oct 30 05:10:56.021970 2017] [wsgi:error] [pid 12:tid 140702473750272] (self.model._meta.object_name, num)
[Mon Oct 30 05:10:56.021975 2017] [wsgi:error] [pid 12:tid 140702473750272] MultipleObjectsReturned: get() returned more than one Product -- it returned 2!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crashmanager/serializers.py at the create method and line 53, then trace the POST flow for /crashmanager/rest/crashes/. Reproduce the MultipleObjectsReturned failure and inspect how duplicate Product records are handled. Done means the endpoint no longer crashes when matching more than one Product and the resulting product association is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100