Bug 1742822

Summary: package profile upload seems to be broken on RHEL7.7
Product: Red Hat Enterprise Linux 7 Reporter: Mike McCune <mmccune>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.7CC: candlepin-bugs, csnyder, cww, egolov, jsefler, mmccune, paji, pstehlik, rdrazny, rhsm-qe, satellite6-bugs
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1742208 Environment:
Last Closed: 2019-08-19 13:18:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1742208, 1754859    
Bug Blocks: 1741577    

Description Mike McCune 2019-08-16 22:00:43 UTC
+++ This bug was initially created as a clone of Bug #1742208 +++

+++ This bug was initially created as a clone of Bug #1741577 +++

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

--- Additional comment from RHEL Product and Program Management on 2019-08-15 13:08:52 UTC ---

Since this issue was entered in Red Hat Bugzilla, the pm_ack has been set to + automatically for the next planned release.

--- Additional comment from Evgeni Golov on 2019-08-15 13:10:53 UTC ---

tfm-rubygem-katello-3.12.0.7-1.el7sat.noarch is the Katello version on the server

--- Additional comment from Evgeni Golov on 2019-08-15 13:14:56 UTC ---

seems also to affect 6.5

--- Additional comment from Partha Aji on 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.

--- Additional comment from Brad Buckingham on 2019-08-16 13:50:09 UTC ---

Partha,

Can you confirm that this issue does not impact releases prior to 6.5.z?  (e.g. 6.3.z/6.4.z)

Thanks!

--- Additional comment from Partha Aji on 2019-08-16 15:39:27 UTC ---

Tested on sat 6.3 with 6.3 host tools and sat 6.4 with 6.4 host tools. Works well

--- Additional comment from RHEL Product and Program Management on 2019-08-16 16:30:43 UTC ---

Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Mike McCune on 2019-08-16 19:47:49 UTC ---

flagging for rhel-7.7.0 as discussed via email with RHEL PM.

--- Additional comment from Chris Snyder on 2019-08-16 21:05:23 UTC ---

FIXED IN
--------
subscription-manager-1.24.15-1.el7

PATCH(ES)
---------
http://pkgs.devel.redhat.com/cgit/rpms/subscription-manager/commit/?id=b70a17f6746aa8d0c5bc580543fbb490404baff2

--- Additional comment from errata-xmlrpc on 2019-08-16 21:06:28 UTC ---

Bug report changed to ON_QA status by Errata System.
A QE request has been submitted for advisory RHBA-2019:44926-01
https://errata.devel.redhat.com/advisory/44926

Comment 2 Chris Williams 2019-08-19 13:18:25 UTC

*** This bug has been marked as a duplicate of bug 1743120 ***