Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Index content is creating duplicated errata in "katello_erratum" table after upgrading to Satellite 6.10. This is because the existing errata has pulp2 id in pulp_id column. The newly created errata will have the errata_id in the pulp_id column. Katello considers them as different errata.
It appears that Satellite doesn't switch the entries in katello_erratum during the content switchover. Is this the expected behaviour? If not, should we remove them and how can we safely remove the old errata (with pulp2 id) which are still associated to the old versions of content view repositories?
foreman-rake console
> pp Katello::Erratum.where(errata_id: "RHBA-2019:1293").first.pulp_id
"78f852c6-44bc-411c-9d43-615b1ea6ccfe" <==== pulp2 id
> pp Katello::Erratum.where(errata_id: "RHBA-2019:1293").second.pulp_id
"RHBA-2019:1293 <=== errata_id
exit
# select errata_id, count(errata_id) count from katello_errata group by errata_id order by count desc;
errata_id | count
----------------+-------
RHEA-2021:1949 | 2
RHEA-2018:0867 | 2
RHSA-2021:0289 | 2
RHBA-2020:5049 | 2
RHBA-2018:3024 | 2
RHBA-2019:2025 | 2
RHSA-2015:1666 | 2
RHBA-2020:4452 | 2
RHSA-2021:0989 | 2
RHBA-2021:0243 | 2
<snip>
The duplicated errata have 0 module streams which break the content view filtering. If you have a filter to "include/exclude all module streams without errata" then unexpected module streams and errata will be included/excluded.
> pp Katello::Erratum.where(errata_id: "RHBA-2019:1293").first.module_streams.size
1 <====
> pp Katello::Erratum.where(errata_id: "RHBA-2019:1293").second.module_streams.size
0 <====
The empty module streams for the duplicated/second erratum can be fixed by applying the following change:
--- a/app/services/katello/pulp3/erratum.rb 2021-12-18 03:12:39.000000000 +1000
+++ b/app/services/katello/pulp3/erratum.rb 2022-02-18 12:06:05.668000000 +1000
@@ -102,7 +102,7 @@
module_stream_id_column = "#{ModuleStreamErratumPackage.table_name}.module_stream_id"
existing = ErratumPackage.joins(:module_streams).
where(module_stream_id_column => module_stream.id,
- :nvrea => nvreas).pluck(:nvrea)
+ :nvrea => nvreas, :erratum_id => model.id).pluck(:nvrea)
(nvreas - existing).each do |nvrea|
package = model.packages.find_by(:nvrea => nvrea)
Katello upstream seems to have included this fix already after refactoring the content indexing codes.
https://github.com/Katello/katello/blob/master/app/services/katello/pulp3/erratum.rb#L106
Steps to Reproduce:
1. Upgrade Satellite from 6.9 to 6.10
2. After upgrading the Satellite, trigger complete sync against one or more repositories (particularly those with module streams) and wait until they are finished.
Actual results:
Duplicated errata created in katello_erratum table. Duplicated modular errata have 0 module streams.
Expected results:
No duplicate errata
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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498