Bug #27288
closedComposite content view doesn't show installable errata/rpms for hosts in non Library lifecycle environment
Description
This issue will happen when a repository is used by 2 or more content views and those content views are added to a same composite content view. When promoting the composite content view to a lifecycle environment, katello mis-considers the cloned repository as a master repository because it has more than 1 source repositories and will try to index the rpms from Pulp and gets 0 errata/rpms.
How to reproduce:
1) Enable a repository and sync it. I use "rhel-7-server-satellite-tools-6.5-rpms" as an example.
2) Create 2 content views.
3) Add "rhel-7-server-satellite-tools-6.5-rpms" to both content views and then publish them.
4) Create a Composite content view and add both content views to it.
5) Publish the content view and then promote it to a lifecycle environment, such as Production.
6) Register a client to the composite content view and enable "rhel-7-server-satellite-tools-6.5-rpms". Make sure the client has some Applicable Errata/Rpms
subscription-manager repos --disable ="*"
subscription-manager repos --enable rhel-7-server-satellite-tools-6.5-rpms
katello-enabled-repos-upload -f
katello-package-upload -f
Inspecting the promoted CCV repository I got 0 errata and rpms.
foreman-rake console
irb(main):001:0> repo = Katello::Repository.find_by_pulp_id("1-my_ccv-production-c8deba8f-c47c-4992-baca-c1ba21fb5785")
- Cloned repository shouldn't be a master
irb(main):006:0> repo.master?
=> true
irb(main):007:0> repo.rpms
=> #<ActiveRecord::Associations::CollectionProxy []>
irb(main):009:0> repo.errata
=> #<ActiveRecord::Associations::CollectionProxy []>
- Expected to have 2 applicable errta and 2 installable errata but not.
irb(main):013:0> h = Host.find_by_name("hao-rhel7-client")
irb(main):060:0> h.content_facet.applicable_errata.size
=> 2
irb(main):063:0> h.content_facet.installable_errata.size
=> 0
Updated by The Foreman Bot over 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/8212 added
Updated by Hao Yu over 5 years ago
After applying the patch, we need to run the following commands to fix the issue:
1) Reindex all the linked repositories
foreman-rake console
Katello::Repository.linked_repositories.each(&:index_content)
exit
2) Recalculate the installable errata for web ui.
foreman-rake katello:import_applicability
Updated by Andrew Kofink over 5 years ago
- Target version set to Katello 3.12.2
- Triaged changed from No to Yes
Updated by Hao Yu over 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|26d445b5e2d02fffcada2732b0908ac1ff82b738.