Bug #21048
closedHaving empty repo in a Content View, Capsule sync of the CV fails on retrieving this repo metadata
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1491646
Description of problem:
Having an empty repository in a Content View and publishing this C.V. or promoting to a L.E., an (automated) attempt to synchronize the C.V. content fails on trying to sync this empty repo with error:
PulpCodedException: Error retrieving metadata: NOT FOUND
Also manual Capsule sync fails the same way.
This situation (empty repo in a C.V.) can happen due to various legitimate reasons and shouldnt be dealt as a user/config error.
Root cause behind this bug: the empty repo is never published on Katello. Because step Actions::Pulp::Repository::DistributorPublish is called with "matching_content: true" - since previously published content (empty) matches current content (empty).
Version-Release number of selected component (if applicable):
tfm-rubygem-katello-3.0.0.144-1.el7sat.noarch
How reproducible:
100%
Steps to Reproduce:
0. Katello with a Capsule in Library environment
1. Have a repo with 1 package
2. Add the repo to a Content View and use filter to exclude the package
3. Publish the repo
4. Check task Actions::Katello::ContentView::CapsuleGenerateAndSync triggered on background
5. Try to sync the Cpasule manually
Actual results:
4. and 5. fails with error
PulpCodedException: Error retrieving metadata: NOT FOUND
on the empty repo
Expected results:
No such error
Additional info:
Refer to bugzilla for additional details.