Bug 2105299

Summary: Email notification shows incorrect new errata after syncing an Epel repository
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: Errata ManagementAssignee: wclark
Status: CLOSED ERRATA QA Contact: addubey
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.6CC: ahumbe, avnkumar, chrobert, damoore, jsherril, mvanderw, pmoravec, r1ch11, sadas, wclark
Target Milestone: 6.12.0Keywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2122177 (view as bug list) Environment:
Last Closed: 2022-11-16 13:34:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hao Chang Yu 2022-07-08 13:04:26 UTC
Description of problem:
I found that 130 errata in the Epel 8 repository always reported as new Errata in the summary of the email notification. Same issue is also observed in Epel 7 repository.

This is caused by the discrepancy between the Pulp update records and the Katello errata records.

1. Some Errata in EPEL repo have trailing whitespace in the description field. Katello strips the trailing whitespace and save the errata into the DB. When comparing this field, both of them don't match due to the trailing whitespace so consider as updated.


Example:
----------------------------------------------
Katello DB
{
  "errata_id"=>"FEDORA-EPEL-2021-3d5da78e55",
  "title"=>"openssh-ldap-authkeys-0.1.0~git20200205.aee4c46-2.el8",
  "description"=>"Initial packaging for Fedora",
}


# Pulp update record
{
  "errata_id"=>"FEDORA-EPEL-2021-3d5da78e55",
  "title"=>"openssh-ldap-authkeys-0.1.0~git20200205.aee4c46-2.el8",
  "description"=>"Initial packaging for Fedora\n",   <================ Trailing whitespace.
}
----------------------------------------------


2. Some Errata in EPEL have none standard long title. Katello limits the Errata title to 255 characters and will truncate the rest. When comparing this field, both of them don't match so consider as updated.


Example:
----------------------------------------------
# Katello DB
{
  "errata_id"=>"FEDORA-EPEL-2021-b87459fd6f",
  "title"=>"certbot-1.22.0-1.el8 python-acme-1.22.0-1.el8 python-certbot-apache-1.22.0-1.el8 python-certbot-dns-cloudflare-1.22.0-1.el8 python-certbot-dns-cloudxns-1.22.0-1.el8 python-certbot-dns-digitalocean-1.22.0-1.el8 python-certbot-dns-dnsimple-1.22.0-1.el8 p...",  <============== Truncated
  "description"=>"update to 1.22.0",
}


# Pulp update record
{
  "errata_id"=>"FEDORA-EPEL-2021-b87459fd6f"
  "title"=>"certbot-1.22.0-1.el8 python-acme-1.22.0-1.el8 python-certbot-apache-1.22.0-1.el8 python-certbot-dns-cloudflare-1.22.0-1.el8 python-certbot-dns-cloudxns-1.22.0-1.el8 python-certbot-dns-digitalocean-1.22.0-1.el8 python-certbot-dns-dnsimple-1.22.0-1.el8 python-certbot-dns-dnsmadeeasy-1.22.0-1.el8 python-certbot-dns-gehirn-1.22.0-1.el8 python-certbot-dns-google-1.22.0-1.el8 python-certbot-dns-linode-1.22.0-1.el8 python-certbot-dns-luadns-1.22.0-1.el8 python-certbot-dns-nsone-1.22.0-1.el8 python-certbot-dns-ovh-1.22.0-1.el8 python-certbot-dns-rfc2136-1.22.0-1.el8 python-certbot-dns-route53-1.22.0-1.el8 python-certbot-dns-sakuracloud-1.22.0-1.el8 python-certbot-nginx-1.22.0-1.el8", 
  "description"=>"update to 1.22.0",
}
----------------------------------------------




Steps to Reproduce:
1. Login and subscribe the user to sync errata email.
2. Create a repository to sync Epel 8 repository. Url: https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/
3. Sync the repository and you should get an email notification which will report all errata as new (excluding some unknown Fedora errata types).
4. Do a complete sync and wait for the task to finish.


Actual results:
Received and email notification reporting 130 new errata.


Expected results:
Should not send email notification because there is no new errata.



Additional info:
The discrepancy mentioned above also happened in Satellite 6.9.9 but it is reporting the new errata correctly because Satellite 6.9.9 won't update the RepositoryErratum association. It will only create new RepositoryErratum association for new errata.

Comment 5 wclark 2022-08-08 14:28:02 UTC
*** Bug 2116375 has been marked as a duplicate of this bug. ***

Comment 19 errata-xmlrpc 2022-11-16 13:34:16 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