Inconsistent repository usage search results after setting a repo to "Override to Enabled"

Upgraded to Foreman 3.7 yesterday and during the upgrade I also create new Foreman client repos for each OS that all hosts subscribe to, ex. foreman-client_3.7_el7.
I am not using “content views” for my hosts, only “Default Organization View, Library”.

So using the legacy “Content Hosts” view (since it is only possible from here) I select the ex. all CentOS 7 hosts, go “Select action” → “Manage Repository Sets” → Select the repo foreman-client_3.7_el7 and “Select action” → “Override to Enabled”.

After the task completed I go back to the Hosts and perform the search:
NOT repository = foreman-client_3.7_el7 and os_title = “CentOS 7”
And up comes ~95% of all hosts that should have received the repo.
Clicking into the “host overview” → “content” → “Repository sets” however shows me that the hosts indeed has the repository set as enabled that showed up in the search result.
Also using “yum repolist” on the host show the repo so only seems the search is not keeping up with what has changed.

Performing the same search after a few hours show 70% of all hosts in the search result. So seems to get better over time?

On Foreman 3.7/Katello 4.9.1.

As a workaround I issued this command to all hosts:
subscription-manager repos --enable=xxx_foreman-client_el7_foreman-client_3_7_el7

After that command, Foreman searches finally matches the configuration.

I was just about to tell you to run that :slight_smile:

subscription-manager repos forces the host to update its enabled repos. (This would happen automatically on a package action or during the host’s regular checkin every 4 hours.) Without this info, Katello won’t have up-to-date information and so cannot update the host’s bound repositories. That’s why you were seeing only 70% of the hosts updated. If you waited until all hosts check in, it should go up to 100%.