RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1848636 - subscription-manager is failing to collect the insights_id fact
Summary: subscription-manager is failing to collect the insights_id fact
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1842946
TreeView+ depends on / blocked
 
Reported: 2020-06-18 16:22 UTC by John Sefler
Modified: 2020-11-04 01:40 UTC (History)
8 users (show)

Fixed In Version: subscription-manager-1.27.9-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:39:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:39:33 UTC

Description John Sefler 2020-06-18 16:22:52 UTC
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 1 Craig Donnelly 2020-06-18 16:51:46 UTC
The issue rests in: Line 37 -> /usr/lib64/python3.6/site-packages/rhsmlib/facts/insights.py

[root@dhcp-13-226-247 ~]# rpm -qf /usr/lib64/python3.6/site-packages/rhsmlib/facts/insights.py
subscription-manager-1.27.6-1.el8.x86_64

 37     DEFAULT_INSIGHTS_MACHINE_ID = "/etc/redhat-access-insights/machine-id"

In RHEL 8.3, this path is invalid.
Before, /etc/redhat-access-insights/machine-id was a symlink to /etc/insights-client/machine-id.
Changing DEFAULT_INSIGHTS_MACHINE_ID to '/etc/insights-client/machine-id' and re-running `subscription-manager facts | grep insights` returns correct result:

 37     DEFAULT_INSIGHTS_MACHINE_ID = "/etc/insights-client/machine-id"

[root@dhcp-13-226-247 ~]# subscription-manager facts | grep insights
insights_id: 6769c853-a092-4040-9b97-bee9a53c4549

It looks like it was a bad choice to use /etc/redhat-access-insights for the path/symlink, as this appears to have been the old path which was migrated from - based on reviewing the older RPM:

>> old rpm:
[root@dhcp-13-226-233 ~]# rpm -q insights-client
insights-client-3.0.13-1.el8_1.noarch

>> migration scripts in RPM:

[root@dhcp-13-226-233 ~]# rpm -q insights-client --scripts
postinstall scriptlet (using /bin/sh):


if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl --no-reload preset insights-client.timer &>/dev/null || : 
fi 


# Only perform migration from redhat-access-insights to insights-client
if  [ $1 -eq 1  ]; then
    #Migrate existing machine-id
    if  [ -f "/etc/redhat_access_proactive/machine-id" ]; then
        cp /etc/redhat_access_proactive/machine-id /etc/insights-client/machine-id
    fi
    #Migrate OTHER existing machine-id
    if [ -f "/etc/redhat-access-insights/machine-id" ]; then
        cp /etc/redhat-access-insights/machine-id /etc/insights-client/machine-id
    fi
    #Migrate existing config
    if [ -f "/etc/redhat-access-insights/redhat-access-insights.conf" ]; then
        cp /etc/redhat-access-insights/redhat-access-insights.conf /etc/insights-client/insights-client.conf
        sed -i 's/\[redhat-access-insights\]/\[insights-client\]/' /etc/insights-client/insights-client.conf
    fi
    #Migrate registration record
    if [ -f "/etc/redhat-access-insights/.registered" ]; then
        cp /etc/redhat-access-insights/.registered /etc/insights-client/.registered
    fi
    if [ -f "/etc/redhat-access-insights/.unregistered" ]; then
        cp /etc/redhat-access-insights/.unregistered /etc/insights-client/.unregistered
    fi
    #Migrate last upload record
    if [ -f "/etc/redhat-access-insights/.lastupload" ]; then
        cp /etc/redhat-access-insights/.lastupload /etc/insights-client/.lastupload
    fi
    #Migrate remove.conf
    if [ -f "/etc/redhat-access-insights/remove.conf" ]; then
        cp /etc/redhat-access-insights/remove.conf /etc/insights-client/remove.conf
    fi
    if ! [ -d "/etc/redhat-access-insights" ]; then
        mkdir /etc/redhat-access-insights
    fi
    # Symlink new cron job if the old one exists. Remove the old one
    if [ -f "/etc/cron.daily/redhat-access-insights" ]; then
        rm -f /etc/cron.daily/redhat-access-insights
            /usr/bin/systemctl start insights-client.timer
    fi 
fi

>> New RPM in 8.3-InternalSnapshot 2.0
[root@dhcp-13-226-247 ~]# rpm -q insights-client
insights-client-3.0.14-2.el8.noarch

There are no RPM scripts that reference that path for this RPM.

As long as this is simply a change going forward for insights-client, I guess there is no need to worry about backward compatibility here?
It appears we should make the change for DEFAULT_INSIGHTS_MACHINE_ID to "/etc/insights-client/machine-id".

Comment 11 Archana Pandey 2020-07-02 15:38:40 UTC
Reproducing isuue on subscription-manager-1.27.6-1.el8.x86_64

Version-Release number of selected component (if applicable):
[root@kvm-07-guest27 /]# rpm -q subscription-manager insights-client
subscription-manager-1.27.6-1.el8.x86_64
insights-client-3.0.14-2.el8.noarch

Steps to Reproduce:
[root@kvm-07-guest27 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Not Specified

[root@kvm-07-guest27 ~]#

[root@kvm-07-guest27 /]# 
[root@kvm-07-guest27 ~]# insights-client --register --no-upload
You successfully registered 52cc2b93-aee8-4986-ae6b-9e6a91263b36 to account 477931.
Successfully registered host kvm-07-guest27.hv2.lab.eng.bos.redhat.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for kvm-07-guest27.hv2.lab.eng.bos.redhat.com
Archive saved at /var/tmp/pk3iw70r/insights-kvm-07-guest27.hv2.lab.eng.bos.redhat.com-20200702105831.tar.gz

[root@kvm-07-guest27 /]# 
[root@kvm-07-guest27 /]# cat /etc/insights-client/machine-id
52cc2b93-aee8-4986-ae6b-9e6a91263b36
[root@kvm-07-guest27 /]# 

[root@kvm-07-guest27 /]# subscription-manager facts | grep "insights_id"
[root@kvm-07-guest27 /]#                                          <<<<<<<<<<< missing insights_id


Actual results:
missing facts collection for insights_id

Expected results:
insights_id: 52cc2b93-aee8-4986-ae6b-9e6a91263b36

==============================================================================================================================================


Verifying bug against subscription-manager-1.27.9-1.el8.x86_64

Version-Release number of selected component (if applicable):
       Beaker Test information:
                         HOSTNAME=kvm-07-guest27.hv2.lab.eng.bos.redhat.com
                            JOBID=4393946
                         RECIPEID=8505380
                    RESULT_SERVER=
                           DISTRO=RHEL-8.3.0-20200701.n.0
                     ARCHITECTURE=x86_64

[root@kvm-07-guest27 ~]# 
[root@kvm-07-guest27 ~]# uname -r
4.18.0-221.el8.x86_64
[root@kvm-07-guest27 ~]# 
[root@kvm-07-guest27 ~]# subscription-manager  version
server type: This system is currently not registered.
subscription management server: 2.9.27-1
subscription management rules: 5.39
subscription-manager: 1.27.9-1.el8

[root@kvm-07-guest27 ~]# insights-client --version
Client: 3.0.14
Core: 3.0.161-1

[root@kvm-07-guest27 /]# rpm -qa subscription-manager --changelog | grep 1848636
- 1848636, 1849074: Update insights machine-id path (csnyder)
[root@kvm-07-guest27 /]# 


Steps for verification:
[root@kvm-07-guest27 ~]# subscription-manager register

[root@kvm-07-guest27 /]# insights-client --register --no-upload
Successfully registered host kvm-07-guest27.hv2.lab.eng.bos.redhat.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for kvm-07-guest27.hv2.lab.eng.bos.redhat.com
Archive saved at /var/tmp/aca1w0sc/insights-kvm-07-guest27.hv2.lab.eng.bos.redhat.com-20200702113123.tar.gz
[root@kvm-07-guest27 /]#
[root@kvm-07-guest27 ~]# cat /etc/insights-client/machine-id
52cc2b93-aee8-4986-ae6b-9e6a91263b36

[root@kvm-07-guest27 ~]# subscription-manager facts | grep "insights_id"
insights_id: 52cc2b93-aee8-4986-ae6b-9e6a91263b36                      <<<<<<<<< insights_id is collected in facts

Actual results:
insights_id: 52cc2b93-aee8-4986-ae6b-9e6a91263b36 

Expected results:
insights_id: 52cc2b93-aee8-4986-ae6b-9e6a91263b36

Comment 14 errata-xmlrpc 2020-11-04 01:39:09 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 and enhancement 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:4460


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