Refresh package applicabillity not working

Hello,

it seems in the new Content Host UI “Refresh package applicabillity” is not working as expected
First time i had to use it

I had a case, where host already had updated packages installed, but Katello didn’t knew about it ( restored whole thing from Backup, but everything is fine otherwise )

When i click on it, it says : Job ‘Run subscription-manager repos’ has started.

Does this command even provide usefull updates to Katello?
Im on SCA

when i log in to host via ssh and run
katello-package-upload -f

it works as expected, needed updates vanished in Content Host UI like it should

How do i update Katello Content Host Page in this case?
I also run “Ansible Gather Facts” on these Hosts, but that didnt update the Content Host page

I thought the Host would report to katello every 4 hr’s ?
But that didnt seems to be the case either, because i waited 10hr+> and the Content Host Page didnt get updated and “last checkin” Time in Content Host UI got not updated either

thanks in advance

greetings
Dominik

Katello version:
3.9.1
Almalinux 8.9 latest updates installed

What OS and OS version is your host using? Normally subscription-manager takes care of the package profile uploads during regular checkin, but if your sub-man is too old, you need katello-host-tools.

Can you check the following on your host?

  • systemctl status rhsmcertd - This is the service that should be checking in with package profile uploads every 4 hours.
  • subscription-manager config --list: Make sure these values are not altered:
    • certcheckinterval = [240] - This controls the time between checkins
    • package_profile_on_trans = [1] - This controls whether a package profile upload is sent after a package install/update.
    • report_package_profile = [1] - This controls whether sub-man will send package profiles.
    • [server] hostname - This is the Foreman server the host is registered to.

Does this problem exist on a single host or multiple hosts?

FYI, usually running subscription-manager repos will cause a package profile upload, but in certain situations it might not. We have an open issue to improve this: Refactor #37225: Update frontend to use new upload_profile REX feature - Katello - Foreman

Hey,
thank you

it seems i’m all good

[rhsm]
   auto_enable_yum_plugins = [1]
   baseurl = https://katello-01.example.com/pulp/content/
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = 1
   inotify = [1]
   manage_repos = [1]
   package_profile_on_trans = 1
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   progress_messages = [1]
   repo_ca_cert = /etc/rhsm/ca/katello-server-ca.pem
   repomd_gpg_url = []
   report_package_profile = [1]

[rhsmcertd]
   auto_registration = [0]
   auto_registration_interval = [60]
   autoattachinterval = [1440]
   certcheckinterval = [240]
   disable = [0]
   splay = [1]

We are running mostly Almalinux 8 / 9
subscription-manager-1.28.40-1.el8_9.alma.1.x86_64
subscription-manager-1.29.38-1.el9_3.alma.1.x86_64

This issue occurred on every Host

katello-package-upload -f means you’re using katello-host-tools rather than subscription-manager. sub-man is supposed to check in every 4 hours. If you run a dnf command, like update or install, do you see the new package reported on the host? I’m trying to find out if your subscription-manager is even sending information over to Katello.

Also, is the /var/lib/rhsm/cache/profile.json file up to date, as in all the latest RPMs are included?

Hi, thanks for asking

everything seems fine
When i run dnf update/install
Packages get reported to Katello as expected

i also checked on two Hosts the content of /var/lib/rhsm/cache/profile.json
seems fine too

in Content Host UI > last checkin also seems fine
every Host checked in this morning

It sounds like at least running dnf commands sends the data to Katello then. As such, Katello should always know the latest packages on the host unless it got updated when not registered to Katello.

If you ever need to definitely update the package profile for a host (or many hosts even), I’d recommend making a remote execution job to run subscription-manager repos && dnf uploadprofile --force-upload. Or, you can use Upload profile - Katello Script Default. Even if it’s not in your version of Katello, you could make this template yourself: Fixes #37191 - upload profile via REX by sbernhard · Pull Request #10900 · Katello/katello · GitHub