Description of problem: CV publish fails if it happen to contain multiple advisories with the same errata_id but different otherwise. Version-Release number of selected component (if applicable): 6.10.0 snap 22 Steps to Reproduce (copied from BZ#1986356#c1, since QE ran into this issue using those steps, see BZ#1986356#c41) - sync a repo (e.g. RH SCL, not a huge one but big enough to see the sequential activity that can be paralelised) - create several CVs with that repo, e.g. with include filters (just to differentiate the CVs, not required, though); below are hammer commands for it (repo id is 4, customise it if required): content-view create --name CV_SCL_filter_no_include_2020-01-01 --organization-id=1 --repository-ids=4 --solve-dependencies=no content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-01-01 --name=include_base --inclusion=true --original-packages=true --type=rpm content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-01-01 --name=include_errata --inclusion=true --type=erratum content-view filter rule create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-01-01 --content-view-filter=include_errata --date-type='updated' --end-date='2020-01-01' content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-01-01 --name=include_modules --inclusion=true --original-module-streams=true --type=modulemd content-view create --name CV_SCL_filter_no_include_2020-04-01 --organization-id=1 --repository-ids=4 --solve-dependencies=no content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-04-01 --name=include_base --inclusion=true --original-packages=true --type=rpm content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-04-01 --name=include_errata --inclusion=true --type=erratum content-view filter rule create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-04-01 --content-view-filter=include_errata --date-type='updated' --end-date='2020-04-01' content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-04-01 --name=include_modules --inclusion=true --original-module-streams=true --type=modulemd content-view create --name CV_SCL_filter_no_include_2020-07-01 --organization-id=1 --repository-ids=4 --solve-dependencies=no content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-07-01 --name=include_base --inclusion=true --original-packages=true --type=rpm content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-07-01 --name=include_errata --inclusion=true --type=erratum content-view filter rule create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-07-01 --content-view-filter=include_errata --date-type='updated' --end-date='2020-07-01' content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-07-01 --name=include_modules --inclusion=true --original-module-streams=true --type=modulemd content-view create --name CV_SCL_filter_no_include_2020-10-01 --organization-id=1 --repository-ids=4 --solve-dependencies=no content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-10-01 --name=include_base --inclusion=true --original-packages=true --type=rpm content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-10-01 --name=include_errata --inclusion=true --type=erratum content-view filter rule create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-10-01 --content-view-filter=include_errata --date-type='updated' --end-date='2020-10-01' content-view filter create --organization-id=1 --content-view=CV_SCL_filter_no_include_2020-10-01 --name=include_modules --inclusion=true --original-module-streams=true --type=modulemd content-view publish --name=CV_SCL_filter_no_include_2020-01-01 --organization-id=1 --async content-view publish --name=CV_SCL_filter_no_include_2020-04-01 --organization-id=1 --async content-view publish --name=CV_SCL_filter_no_include_2020-07-01 --organization-id=1 --async content-view publish --name=CV_SCL_filter_no_include_2020-10-01 --organization-id=1 --async Actual results: Errors with "get() returned more than one UpdateRecord -- it returned 2!`" pulp [59cc0e4d-b1d3-4e83-be25-a010e9413044]: pulpcore.tasking.pulpcore_worker:INFO: Task 1584fe74-28d1-4d63-9710-b1b4e36a6e1c failed (get() returned more than one UpdateRecord -- it returned 2!) pulp [59cc0e4d-b1d3-4e83-be25-a010e9413044]: pulpcore.tasking.pulpcore_worker:INFO: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 317, in _perform_task result = func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/pulpcore/app/tasks/repository.py", line 219, in add_and_remove new_version.add_content(models.Content.objects.filter(pk__in=add_content_units)) File "/usr/lib/python3.6/site-packages/pulpcore/app/models/repository.py", line 963, in __exit__ repository.finalize_new_version(self) File "/usr/lib/python3.6/site-packages/pulp_rpm/app/models/repository.py", line 353, in finalize_new_version resolve_advisories(new_version, previous_version) File "/usr/lib/python3.6/site-packages/pulp_rpm/app/advisory.py", line 87, in resolve_advisories previous_advisory = previous_advisories.get(id=advisory_id) File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 412, in get (self.model._meta.object_name, num) pulp [59cc0e4d-b1d3-4e83-be25-a010e9413044]: pulpcore.tasking.pulpcore_worker:INFO: Task e9a64af6-047f-48d6-825d-48108e9e3c26 failed (get() returned more than one UpdateRecord -- it returned 2!) pulp [59cc0e4d-b1d3-4e83-be25-a010e9413044]: pulpcore.tasking.pulpcore_worker:INFO: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 317, in _perform_task result = func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/pulpcore/app/tasks/repository.py", line 219, in add_and_remove new_version.add_content(models.Content.objects.filter(pk__in=add_content_units)) File "/usr/lib/python3.6/site-packages/pulpcore/app/models/repository.py", line 963, in __exit__ repository.finalize_new_version(self) File "/usr/lib/python3.6/site-packages/pulp_rpm/app/models/repository.py", line 353, in finalize_new_version resolve_advisories(new_version, previous_version) File "/usr/lib/python3.6/site-packages/pulp_rpm/app/advisory.py", line 88, in resolve_advisories added_advisory = UpdateRecord.objects.get(id=advisory_id, pk__in=added_advisory_pks) File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 412, in get (self.model._meta.object_name, num) Expected results: No errors Additional info: See related convo BZ#1986356#c41
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.
Please include in 6.10.1
Removed the foreman redmine (https://projects.theforeman.org/issues/33648) as that fix is being tracked with bug 2011528.
Fixed in the upstream pulp_rpm 3.14.7
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.
I followed the description for retesting. Publishing the cv returns successfully and no more errors showed up. Verified on 6.10.1_01
*** Bug 2018888 has been marked as a duplicate of this bug. ***
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Satellite 6.10.1 Async Bug Fix Update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4737