Exclude filter of puppet-agent RPM leaves one version of the RMP in the filtered content in Satellite6
Environment
Red Hat Satellite 6.14
Issue
Having a Content View with a "Red Hat Satellite Client 6 for RHEL 8" repository, we want to filter out puppet-agent packages from it.
Adding a filter to exclude all versions of the package, the published Content View version does filter out just one package (puppet-agent-7.16.0-2.el8sat.x86_64) but leaves another (puppet-agent-7.26.0-3.el8sat.x86_64) in the CV.
Resolution
Run below rake script to mark the puppet-agent package as non-modular:
cat << EORAKE | foreman-rake console
::Organization.unscoped.all.each do |organization|
relpath = organization.name + "/Library/content/dist/layered/rhel8/x86_64/sat-client/6/os"
::Katello::Repository.where(relative_path: relpath, library_instance_id: nil).each do |repo|
repo.rpms.where(:modular => true).each do |rpm|
rpm.modular=false
rpm.save
end
end
end
EORAKE
Then publish a new version of the affected CV.
For more KB articles/solutions related to Red Hat Satellite 6.x Content View Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Content View Issues
Root Cause
The puppet-agent-7.26.0-3.el8sat.x86_64 package was first synchronized from Satellite 6.14 or Capsule 6.14 repository. Those repos treat the package as modular, hence katello stores the package as a modular one.
Later on, Satellite 6.14 client repository was synchronized. That contains the same package but non-modular. Due to pulp package deduplication, both packages were merged into the first one. Therefore the Satellite client repository (that has no modularity at all) contains a modular package.
Applying RPM filters to a Content View behaves differently for modular and non-modular packages, causing the modular package is not excluded by the "remove all packages of given name" filter.
Resetting modularity flag of the package (in fact, of all packages in the Satellite client repository) then resolves the root cause of the problem.
The issue is raised as This content is not included.this bugzilla.
Diagnostic Steps
See modular = 't' for puppet-agent-7.26.0-3.el8sat.x86_64.rpm package in the below output (Example):
# su - postgres -c "psql foreman -c \"SELECT id,filename,modular FROM katello_rpms WHERE name = 'puppet-agent';\""
id | filename | modular
--------+-----------------------------------------+---------
388567 | puppet-agent-7.27.0-1.el8sat.x86_64.rpm | t
118286 | puppet-agent-7.26.0-3.el8sat.x86_64.rpm | t
118287 | puppet-agent-7.16.0-2.el8sat.x86_64.rpm | f
118605 | puppet-agent-7.26.0-3.el9sat.x86_64.rpm | f
118606 | puppet-agent-7.16.0-2.el9sat.x86_64.rpm | f
(5 rows)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.