Issue #4880
closedMissing rpms in erratum pkglist when an erratum appears in multiple repos caused wrong applicability calculation.
Description
Description of problem:
Pulp will returns wrong 'pkglist' if an erratum exists in multiple repositories and user syncs multiple of these repositories
For example:
Erratum 'RHSA-2019:1235' exists in both 'rhel-7-server-rpms' repo and 'rhel-7-server-optional-debug-rpms' repo with the following 'pkglist' respectively
rhel-7-server-rpms:
"ruby-libs-2.0.0.648-35.el7_6.x86_64.rpm",
"ruby-libs-2.0.0.648-35.el7_6.i686.rpm",
"ruby-2.0.0.648-35.el7_6.x86_64.rpm",
"rubygem-bigdecimal-1.2.0-35.el7_6.x86_64.rpm",
"rubygem-psych-2.0.0-35.el7_6.x86_64.rpm",
"rubygem-rdoc-4.0.0-35.el7_6.noarch.rpm",
"ruby-irb-2.0.0.648-35.el7_6.noarch.rpm",
"rubygem-io-console-0.4.2-35.el7_6.x86_64.rpm",
"rubygems-2.0.14.1-35.el7_6.noarch.rpm",
"rubygem-json-1.7.7-35.el7_6.x86_64.rpm"
rhel-7-server-optional-debug-rpms:
"ruby-debuginfo-2.0.0.648-35.el7_6.x86_64.rpm",
After syncing these 2 repos to the Satellite, Pulp will only list the 'ruby-debuginfo rpm' in the erratum 'pkglist'. Pulp will calculate the wrong applicability for the consumer because the erratum is listing only 1 rpm.
Test in "foreman-rake console":
- Before enabling debug repo, the erratum shows 10 packages:
pp Katello::pulp_server.resources.repository.unit_search("046aa6b4-6369-4ef7-a3f7-3959250bd86f", {:type_ids => ['erratum'], filters: {unit: {"errata_id": "RHSA-2019:1235"}}})[0]['metadata']['pkglist'][0]['packages'].size
10
- After enabling and sync debug repo. the erratum shows only 1 package.
pp Katello::pulp_server.resources.repository.unit_search("046aa6b4-6369-4ef7-a3f7-3959250bd86f", {:type_ids => ['erratum'], filters: {unit: {"errata_id": "RHSA-2019:1235"}}})[0]['metadata']['pkglist'][0]['packages'].size
1
pp Katello::pulp_server.resources.repository.unit_search("046aa6b4-6369-4ef7-a3f7-3959250bd86f", {:type_ids => ['erratum'], filters: {unit: {"errata_id": "RHSA-2019:1235"}}})[0]['metadata']['pkglist'][0]['packages'][0]['filename']
"ruby-debuginfo-2.0.0.648-35.el7_6.x86_64.rpm"
exit
Steps to Reproduce:
1. Ensure you have a RHEL 7 client with older ruby version. Lets say Client 'A'.
2. Enable and sync 'rhel-7-server-rpms' repo
3. Go to Web UI -> Hosts -> Content Hosts -> Client 'A' -> Errata tab -> Filter "id = RHSA-2019:1235" should show this erratum is applicable/installable.
4. Enable and sync 'rhel-7-server-optional-debug-rpms' repo
5. Now need to do something so that we can FORCE recalculate the applicability for Client 'A'
On client 'A' do:
subscription-manager repos --enable="rhel-7-server-optional-debug-rpms"
katello-enabled-repos-upload -f
6. Wait for the regenerate applicability task to finish
7. Go to Web UI -> Hosts -> Content Hosts -> Client 'A' -> Errata tab -> Filter "id = RHSA-2019:1235" shows empty result.
Actual results:
Errata RHSA-2019:1235 is not applicable to Client A
Expected results:
Errata RHSA-2019:1235 is applicable to the Client A
Related issues
Fix serializer for erratum pkglists
It didn't affect publish results, however it did affect applicability calculations and erratum content which user query via API.
Kudos to Hyu (reporter of the issue) for the patch.
closes #4880 https://pulp.plan.io/issues/4880