Bug 1849074

Summary: subscription-manager is failing to collect the insights_id fact
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.9CC: candlepin-bugs, csnyder, jsefler, jwboyer, rjerrido
Target Milestone: rcKeywords: Regression, 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: Environment:
Last Closed: 2020-09-29 19:24:22 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:

Description Rehana 2020-06-19 14:41:01 UTC
This bug was initially created as a copy of Bug #1848636

I am copying this bug because: 



Description of problem:
After a successful registration using rhsm and insights-client, the insights machine_id is missing from the subscription-manager facts collection.

Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-13 ~]# rpm -q subscription-manager insights-client
subscription-manager-1.27.6-1.el8.x86_64
insights-client-3.0.14-2.el8.noarch


How reproducible:


Steps to Reproduce:
[root@ibm-x3650m4-01-vm-13 ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: rhelentqe
Password: 
The system has been registered with ID: c266c656-4a3d-473d-a3ca-d8b4b56133b6
The registered system name is: ibm-x3650m4-01-vm-13.ibm2.lab.eng.bos.redhat.com
[root@ibm-x3650m4-01-vm-13 ~]# 
[root@ibm-x3650m4-01-vm-13 ~]# insights-client --register --no-upload
You successfully registered f1261596-bd10-4a38-a970-76e48a0329ae to account 6219681.
Successfully registered host ibm-x3650m4-01-vm-13.ibm2.lab.eng.bos.redhat.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for ibm-x3650m4-01-vm-13.ibm2.lab.eng.bos.redhat.com
Archive saved at /var/tmp/9niuzt50/insights-ibm-x3650m4-01-vm-13.ibm2.lab.eng.bos.redhat.com-20200618121444.tar.gz
[root@ibm-x3650m4-01-vm-13 ~]# 
[root@ibm-x3650m4-01-vm-13 ~]# cat /etc/insights-client/machine-id 
f1261596-bd10-4a38-a970-76e48a0329ae
[root@ibm-x3650m4-01-vm-13 ~]# 
[root@ibm-x3650m4-01-vm-13 ~]# 
[root@ibm-x3650m4-01-vm-13 ~]# subscription-manager facts | grep "insights_id"
[root@ibm-x3650m4-01-vm-13 ~]# 
[root@ibm-x3650m4-01-vm-13 ~]# 


Actual results:
nothing - nada - missing facts collection for insights_id

Expected results:
insights_id: f1261596-bd10-4a38-a970-76e48a0329ae

Additional info:

Comment 6 John Sefler 2020-06-25 16:06:33 UTC
Verifying Version....

[root@hpe-dl380pgen8-02-vm-7 ~]# rpm -q subscription-manager
subscription-manager-1.24.42-1.el7.x86_64
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# rpm -q subscription-manager --changelog | grep 1849074
- 1848636, 1849074: Update insights machine-id path (csnyder)
[root@hpe-dl380pgen8-02-vm-7 ~]# 

TEST 1___________________________________________________
Testing with current version of insights-client targeted for RHEL7.9...

[root@hpe-dl380pgen8-02-vm-7 ~]# rpm -q insights-client
insights-client-3.0.13-1.el7.noarch
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/insights-client/machine-id
cat: /etc/insights-client/machine-id: No such file or directory
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-access-insights/machine-id
cat: /etc/redhat-access-insights/machine-id: No such file or directory
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: **REDACTED**
Password: 
The system has been registered with ID: 621a51b0-233a-4648-8ccb-db5eb079ec70
The registered system name is: hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager facts | grep insights_id
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# insights-client --register --no-upload
You successfully registered f636a426-a6f0-4630-a9bc-705c8a787e8b to account 477931.
Successfully registered host hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
Archive saved at /var/tmp/DkNJqf/insights-hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com-20200625113236.tar.gz
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/insights-client/machine-id
f636a426-a6f0-4630-a9bc-705c8a787e8b
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-access-insights/machine-id
f636a426-a6f0-4630-a9bc-705c8a787e8b
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager facts | grep insights_id
insights_id: f636a426-a6f0-4630-a9bc-705c8a787e8b
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# ls -l /etc/insights-client/machine-id
-rw-r--r--. 1 root root 36 Jun 25 11:32 /etc/insights-client/machine-id
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# ls -l /etc/redhat-access-insights/machine-id
lrwxrwxrwx. 1 root root 31 Jun 25 11:32 /etc/redhat-access-insights/machine-id -> /etc/insights-client/machine-id
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager facts | grep insights_id
insights_id: f636a426-a6f0-4630-a9bc-705c8a787e8b
[root@hpe-dl380pgen8-02-vm-7 ~]# 

VERIFIED: subscription-manager-1.24.42-1 correctly collects the insights_id as a fact when insights-client-3.0.13-1 is installed


CLEAN THE SYSTEM_________________________________________
[root@hpe-dl380pgen8-02-vm-7 ~]# insights-client --unregister
Successfully unregistered from the Red Hat Insights Service
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.
[root@hpe-dl380pgen8-02-vm-7 ~]# rm -f /etc/insights-client/machine-id
[root@hpe-dl380pgen8-02-vm-7 ~]# rm -f /etc/redhat-access-insights/machine-id


TEST 2___________________________________________________
Testing based on lessons learned in https://bugzilla.redhat.com/show_bug.cgi?id=1848636#c1 which demonstrated that a future versions of insights-client will no longer manage the "/etc/redhat-access-insights/machine-id" symlink.  To test this on rhel-7, we will manually delete the symlink and verify that subscription-manager will still collect the insights_id fact....

[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/insights-client/machine-id
cat: /etc/insights-client/machine-id: No such file or directory
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-access-insights/machine-id
cat: /etc/redhat-access-insights/machine-id: No such file or directory
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: **REDACTED**
Password: 
The system has been registered with ID: 61ff099a-64b6-4aaf-92f4-5f2983905c10
The registered system name is: hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager facts | grep insights_id
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# insights-client --register --no-upload
You successfully registered fd269202-c0d8-4644-a5b5-0704b02ad2f5 to account 477931.
Successfully registered host hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com
Archive saved at /var/tmp/LZ6dZD/insights-hpe-dl380pgen8-02-vm-7.hpe2.lab.eng.bos.redhat.com-20200625115555.tar.gz
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# rm -f /etc/redhat-access-insights/machine-id
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/insights-client/machine-id
fd269202-c0d8-4644-a5b5-0704b02ad2f5
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-access-insights/machine-id
cat: /etc/redhat-access-insights/machine-id: No such file or directory
[root@hpe-dl380pgen8-02-vm-7 ~]# 
[root@hpe-dl380pgen8-02-vm-7 ~]# subscription-manager facts | grep insights_id
insights_id: fd269202-c0d8-4644-a5b5-0704b02ad2f5
[root@hpe-dl380pgen8-02-vm-7 ~]# 

VERIFIED: subscription-manager-1.24.42-1 correctly collects the insights_id as a fact when path "/etc/redhat-access-insights/machine-id" is absent.

Comment 8 errata-xmlrpc 2020-09-29 19:24:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (subscription-manager bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3866