Bug 1741577 - package profile upload seems to be broken on RHEL7.7
Summary: package profile upload seems to be broken on RHEL7.7
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: 6.6.0
Assignee: Partha Aji
QA Contact: Radovan Drazny
URL:
Whiteboard:
Depends On: 1742208 1742822 1743120 1754859
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-15 13:08 UTC by Evgeni Golov
Modified: 2019-09-24 08:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1742208 (view as bug list)
Environment:
Last Closed: 2019-08-22 14:49:14 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27650 0 Normal Closed package profile upload & repos upload needs to use subman combined profiles 2021-02-01 19:28:47 UTC

Description Evgeni Golov 2019-08-15 13:08:44 UTC
Description of problem:
Since the upgrade (of the client) to RHEL 7.7, "yum install <something>" seems not to properly trigger a package profile upload, leading to wrongly calculated errata information


Version-Release number of selected component (if applicable):
katello-host-tools-3.5.1-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. yum install walrus-0.71-1
2. hammer host errata list --host <hostname>

Actual results:
# yum install walrus-0.71-1
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager, tracer_upload, versionlock
Satellite-Satellite-6.6-compose                                                                                                                                                                                                                                    | 4.2 kB  00:00:00     
Test_Organization_Test_Product_Zoo                                                                                                                                                                                                                                 | 2.1 kB  00:00:00     
sattools-6.6-compose                                                                                                                                                                                                                                               | 3.8 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package walrus.noarch 0:0.71-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================
 Package      Arch          Version   Repository           Size
=========================
Installing:
 walrus      noarch          0.71-1   Test_Organization_Test_Product_Zoo      2.4 k

Transaction Summary
=========================
Install  1 Package

Total download size: 2.4 k
Installed size: 84  
Is this ok [y/d/N]: y
Downloading packages:
walrus-0.71-1.noarch.rpm      | 2.4 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : walrus-0.71-1.noarch                                                                                                                                                                                                                                                   1/1 
Uploading Package Profile
Uploading Tracer Profile
  Verifying  : walrus-0.71-1.noarch                                                                                                                                                                                                                                                   1/1 

Installed:
  walrus.noarch 0:0.71-1                                                                                                                                                                                                                                                                  

Complete!

# hammer host errata list --host $(hostname -f)
---|------------|------|-------|------------
ID | ERRATUM ID | TYPE | TITLE | INSTALLABLE
---|------------|------|-------|------------


Expected results:
# hammer host errata list --host $(hostname -f)
---|----------------|----------|-------------|------------
ID | ERRATUM ID     | TYPE     | TITLE       | INSTALLABLE
---|----------------|----------|-------------|------------
4  | RHEA-2012:0055 | security | Sea_Erratum | true       
---|----------------|----------|-------------|------------


Additional info:
"katello-package-upload -f" works as a workaround

Comment 2 Evgeni Golov 2019-08-15 13:10:53 UTC
tfm-rubygem-katello-3.12.0.7-1.el7sat.noarch is the Katello version on the server

Comment 3 Evgeni Golov 2019-08-15 13:14:56 UTC
seems also to affect 6.5

Comment 4 Partha Aji 2019-08-15 21:59:55 UTC
TLDR work - around-
package_profile_on_trans=0 in /etc/rhsm/rhsm.conf


Explanation: 
Satellite needs reports on Enabled repositories, and installed packages from the client in order to do Errata Management.
These reports used to be provided to the satellite by plugins installed via katello-host-tools rpm.

In RHEL 8 we moved the upload functionality to subscription-manager (subscription-manager 1.23.2 and above.) 
Subscription manager added dnf plugins for this functionality but not yum plugins (used in rhel7.)
As a side effect we require katello-host-tools plugins to be installed on RHEL 7 and have it call subscription-manager.

The way its written Katello-host-tools will check if subscription-manager handles the upload using a config entry in /etc/rhsm/rhsm.conf. 
If it notices package_profile_on_trans=1, it stops running any further with the assumption that subman plugins will handle the upload.
OTOH if host tools notices that package_profile_on_trans=0, it directs the subman to upload the package profile.

The problem here occurs because on a 6.5+ Satellite the bootstrap rpm automatically attempts to set package_profile_on_trans to 1 in /etc/rhsm/rhsm.conf .  In RHEL 7.7 and 8
that config entry is set to 1. In RHEL 7.6 and before this was not an issue because subscription-manager would fail on an invalid config entry (and hence this var would not get set.)
In RHEL 7.7 the subscription manager allows for the config entry but does not do any plugin uploading by itself. 

Quick Fix - Short term
---------
Have the bootstrap script say "If rhel7 set package_profile_on_trans=0". This change would force host tools to always do the uploading (via subman connection).

Long Term:
---------
Subman has to have  yum plugins to upload the profile reports automatically. We can then not require host tools for update.

Comment 7 Partha Aji 2019-08-17 05:27:57 UTC
Connecting redmine issue https://projects.theforeman.org/issues/27650 from this bug

Comment 10 Brad Buckingham 2019-08-22 14:49:14 UTC
Closing this one as a WONTFIX on Satellite product as we are looking to deliver a fix within subscription-manager (RHEL).


Note You need to log in before you can comment on or make changes to this bug.