Bug 2128256

Summary: Insights recommendation sync failing in Satelliite
Product: Red Hat Satellite Reporter: Riya Banerjee <ribanerj>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Griffin Sullivan <gsulliva>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.11.2CC: achadha, ahumbe, aruzicka, bbuckingham, gsulliva, jpathan, lphiri, pcreech, sshtein, theute, wclark
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_rh_cloud-6.0.44 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2150111 2166762 (view as bug list) Environment:
Last Closed: 2023-05-03 13:22:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Hotfix RPM for Satellite 6.11.4 on RHEL7
none
Hotfix RPM for Satellite 6.11.4 on RHEL8
none
Hotfix RPM for Satellite 6.12.0 none

Description Riya Banerjee 2022-09-20 12:05:27 UTC
Description of problem:
Insights recommendation sync is failing with NilClass error.
It worked when Satellite was still in version 6.8

Version-Release number of selected component (if applicable): satellite-installer-6.11.0.7-1.el7sat.noarch , Insights {"core_version": "3.0.293-1", "client_version": "3.1.7"}


Steps to Reproduce:
Navigate to Satellite UI > RH Cloud > Inventory Upload > Click 'Sync inventory status'


Actual results: Fails with NilClass error.


Expected results: Inventory sync should complete successfully

Comment 17 wclark 2022-12-06 21:30:16 UTC
Created attachment 1930612 [details]
Hotfix RPM for Satellite 6.11.4 on RHEL7

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.11.4 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # yum install ./tfm-rubygem-foreman_rh_cloud-5.0.43-2.HOTFIXRHBZ2128256.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 18 wclark 2022-12-06 21:32:11 UTC
Created attachment 1930613 [details]
Hotfix RPM for Satellite 6.11.4 on RHEL8

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.11.4 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # dnf install ./rubygem-foreman_rh_cloud-5.0.43-2.HOTFIXRHBZ2128256.el8sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 19 wclark 2022-12-08 10:46:50 UTC
Created attachment 1931029 [details]
Hotfix RPM for Satellite 6.12.0

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.12.0 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # dnf install ./rubygem-foreman_rh_cloud-6.0.42.2-2.HOTFIXRHBZ2128256.el8sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 20 Griffin Sullivan 2023-01-17 16:49:48 UTC
Verified with:
- Satellite 6.13 snap 6
- rubygem-foreman_rh_cloud-6.0.44-1.el8sat.noarch

Test steps:
- Have an inventory host(registered with Satellite) with fqdn set to null.
- Go to Configure > Inventory upload > Click 'Sync inventory status'

Observations:
- No error
- 'Sync inventory status' task was completed successfully.

Additional info:
Use the following steps to get a host with null fqdn in inventory.

- Get a fresh host(not uploaded to inventory or delete existing one from inventory)
- insights-client --no-upload --keep-archive
- cp /var/cache/insights-client/insights-host.example.com-20230103095159.tar.gz .
- tar -xzf *.tar.gz
- vi insights-host.example.com-20230103095159/data/insights_commands/hostname* (emptied the files)
- rm insights-host.example.com-20230103095159.tar.gz 
- tar -czf insights-host.example.com-20230103095159.tar.gz insights-host.example.com-20230103095159
- insights-client --payload=insights-host.example.com-20230103095159.tar.gz --content-type="application/vnd.redhat.advisor.payload+tgz"
- curl -sSu "username:password" "https://console.redhat.com/api/inventory/v1/hosts/<id-of-host>" | jq '.results[0]'

Comment 23 errata-xmlrpc 2023-05-03 13:22:03 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 (Important: Satellite 6.13 Release), 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/RHSA-2023:2097