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.
Bug 2102867 - Post upgrade to satellite 6.10, sync summary email notification shows the incorrect summary for newly added errata.
Summary: Post upgrade to satellite 6.10, sync summary email notification shows the inc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Errata Management
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 6.12.0
Assignee: satellite6-bugs
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-30 20:55 UTC by Odilon Sousa
Modified: 2023-09-18 04:40 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2044314
Environment:
Last Closed: 2022-11-16 13:34:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34414 0 Normal Closed Post upgrade to 4.1, sync summary email notification shows the incorrect summary for newly added errata. 2022-06-30 20:55:22 UTC
Foreman Issue Tracker 35053 0 Normal Closed No longer receive errata email notification after syncing repository when there are new errata. 2022-06-30 20:55:22 UTC
Github Katello katello pull 10163 0 None Merged Fixes #35053 - User no longer receive errata email notification 2022-06-30 20:55:22 UTC
Red Hat Issue Tracker SAT-12491 0 None None None 2022-08-25 16:10:11 UTC
Red Hat Knowledge Base (Solution) 6958610 0 None None None 2022-06-30 20:55:22 UTC
Red Hat Knowledge Base (Solution) 6964837 0 None None None 2022-06-30 20:55:22 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:34:30 UTC

Comment 1 Bryan Kearney 2022-07-01 00:04:45 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34414 has been resolved.

Comment 2 Pavel Moravec 2022-07-30 12:29:20 UTC
This bugfix is NOT sufficient!

Copying and explaining observation from https://bugzilla.redhat.com/show_bug.cgi?id=2044314#c44 :

In Sat6.11.1 with the fix applied, syncing 7Server RHSCL repo ended up in mail notification:

Email:
SYNC SUMMARY
The synchronization of "Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server" has completed. Below is a summary of new errata. A large number of errata were synced for this repository, so only the first 100 are shown. 

New Errata
44 SECURITY	
28 BUGFIX	
74 ENHANCEMENT


What errata are in the mail? Generally those having katello_repository_errata.updated_at being *updated* during the sync. Which includes e.g. RHBA-2015:1068 or RHEA-2015:0883 or RHEA-2014:1749 .

Why such old errata are "updated"? Here is the reasoning:
- there is just one record for katello_errata.pulp_id = 'RHBA-2015:1068', *not* updated during the extra sync (that sent the errata in mail).
- BUT katello does not list errata per katello_errata - it lists them from katello_repository_errata.updated_at, which *was* updated during the last sync
- when this record is updated? Whenever pulp updates content of its repo, like:

rpm_updaterecord :
            content_ptr_id            |       id       |    updated_date     | ..
 2a6c640c-31d8-4914-a106-519cab99ab0a | RHBA-2015:1068 | 2015-06-04 00:00:00 | ..
 a57aad7d-d9d6-48ec-8601-6645bf9b7b5b | RHBA-2015:1068 | 2015-06-04 00:00:00 

The errata instances differ in digest only (see below). One "errata instance" was added to *previous* repo version (per core_repositoryversion), then removed and new errata instance added to the current repo version.

- why pulp replaced one errata instance by another? B'cos during the repo sync, it detected (the same) errata under a different digest. Errata digest is a hash from update record in repo metadata, per https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/advisory.py#L418-L431

- and indeed, some time ago, the RHSCL updateinfo had:

  <update from="release-engineering" status="final" type="bugfix" version="1">
    <id>RHBA-2015:1068</id>
    <title>nginx16 bug fix and enhancement update</title>
    <issued date="2015-06-04 00:00:00"/>
    <updated date="2015-06-04 00:00:00"/>
    <rights>Copyright 2015 Red Hat Inc</rights>
    <release></release>
    <pushcount>4</pushcount>
    <severity></severity>
    <summary>Updated nginx16 packages that ..

while now:

  <update status="final" from="release-engineering" version="1" type="bugfix">
    <id>RHBA-2015:1068</id>
    <issued date="2015-06-04 00:00:00" />
    <title>nginx16 bug fix and enhancement update</title>
    <rights>Copyright 2015 Red Hat Inc</rights>
    <solution>Before applying this update, ..

Content is the same, just reordered. So hash of it is different.


Therefore, whenever an updateinfo of an errata changes *ordering* of otherwise identical items, for one repo (e.g. on CDN), then katello marks the errata as "New Errata" in the notification mail.


Possible improvements:
- ensure updateinfo of same errata is consistent over time on CDN - this would be hardly achieved
- change digest calculation in pulp to ignore ordering of updateinfo items - possible, but redundantly complex (I think), also prone to some different subtle change that would end up in different digest of the same errata
- change katello email notification : do not filter errata's updated_at from katello_repository_errata, but from inner join of katello_errata:

currently:
foreman=# SELECT COUNT(kre.updated_at),kre.updated_at FROM katello_errata AS ke INNER JOIN katello_repository_errata AS kre on kre.erratum_id = ke.id WHERE kre.repository_id = 19 GROUP BY kre.updated_at ORDER BY kre.updated_at DESC;
 count |     updated_at      
-------+---------------------
   146 | 2022-07-30 11:34:24
   518 | 2022-07-30 11:18:48
(2 rows)

foreman=# 

(that is why 146 errata sent in the mail)

proposal:
foreman=# SELECT COUNT(ke.updated_at),ke.updated_at FROM katello_errata AS ke INNER JOIN katello_repository_errata AS kre on kre.erratum_id = ke.id WHERE kre.repository_id = 19 GROUP BY ke.updated_at ORDER BY ke.updated_at DESC;
 count |         updated_at         
-------+----------------------------
     1 | 2022-07-30 11:34:15.839358
     1 | 2022-07-30 11:18:48.426889
     1 | 2022-07-30 11:18:48.414097
     1 | 2022-07-30 11:18:48.400287
..

as really just *one* errata was created/updated by the sync ("Added Rpms: 22, Errata: 1").

I.e. in /usr/share/gems/gems/katello-4.3.0.42/app/lib/actions/katello/repository/errata_mail.rb :

          repo = ::Katello::Repository.find(input[:repo])
          last_updated = repo.repository_errata.order('updated_at ASC').last.try(:updated_at) || Time.now
          users = ::User.select { |user| user.receives?(:sync_errata) && user.organization_ids.include?(repo.organization.id) && user.can?(:view_products, repo.product) }.compact
          errata = ::Katello::Erratum.where(:id => repo.repository_errata.where('katello_repository_errata.updated_at > ?', last_updated).pluck(:erratum_id))

change that to:

          errata = ::Katello::Erratum.where(:id => repo.repository_errata).where('updated_at > ?', last_updated).pluck(:erratum_id))

(I havent checked the syntax)


Partha, as the Repositories team lead, does it sound reasonable? Or could this lead to some other issues (I dont see in my tunnelled view of current problem)?

Comment 3 Pavel Moravec 2022-07-30 12:37:47 UTC
Checked the syntax of my proposal and it should be:

          errata = ::Katello::Erratum.where(:id => repo.repository_errata.pluck(:erratum_id)).where('updated_at < ?', last_updated)

Comment 5 Pavel Moravec 2022-08-08 12:42:24 UTC
I raised https://bugzilla.redhat.com/show_bug.cgi?id=2116375 for the above bug (as I cant reopen the 6.11.1 closed clone).

Comment 14 errata-xmlrpc 2022-11-16 13:34:14 UTC
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 (Important: Satellite 6.12 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:8506

Comment 15 Red Hat Bugzilla 2023-09-18 04:40:48 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.