Project

General

Profile

Actions

Bug #10703

closed

get() returned more than one UnsafeConvertionCache

Added by Evgeny Novikov almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Immediate
Category:
Bridge
Target version:
Start date:
02/05/2021
Due date:
02/08/2021
% Done:

100%

Estimated time:
Detected in build:
git
Platform:
Published in build:

Description

Pavel reached the exception that prevents any futher expert assessment:

get() returned more than one UnsafeConvertionCache -- it returned 2!
Traceback (most recent call last):
  File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/var/www/klever-bridge/bridge/marks/api.py", line 136, in create
    mark, cache_id = perform_unsafe_mark_create(self.request.user, report, serializer)
  File "/var/www/klever-bridge/bridge/marks/UnsafeUtils.py", line 43, in perform_unsafe_mark_create
    conv = UnsafeConvertionCache.objects.get(unsafe=report, converted__function=convert_func).converted
  File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/django/db/models/query.py", line 422, in get
    num if not limit or num < limit else 'more than %s' % (limit - 1),
marks.models.UnsafeConvertionCache.MultipleObjectsReturned: get() returned more than one UnsafeConvertionCache -- it returned 2!

We should give him an ability to proceed!

Actions #1

Updated by Vladimir Gratinskiy almost 4 years ago

  • Due date set to 02/05/2021
  • % Done changed from 0 to 90

New feature to fix such problems was implemented in "bridge-fixes", commit "adcf22cb". Button "Remove unused files and DB rows" on manager panel page will fix the issue. Similar workaround should be done for source code cache soon.

Actions #2

Updated by Vladimir Gratinskiy almost 4 years ago

  • Due date changed from 02/05/2021 to 02/08/2021
  • Status changed from New to Resolved
  • % Done changed from 90 to 100

Some problems were also fixed in the commit "646d726d". Proposed approach was implemented for the visualized source code cache as well (commit "ac3ffd1b").

Actions #3

Updated by Evgeny Novikov almost 4 years ago

  • Status changed from Resolved to Closed

CI passed tests, so, I picked corresponding commits to master and to v3.0-stable.

Actions

Also available in: Atom PDF