Bug 1817521

Summary: Host data sent to cloud.redhat.com inventory in invalid format
Product: Red Hat Satellite Reporter: Jozef Hartinger <jharting>
Component: RH Cloud - InventoryAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: bkearney, pcreech
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
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-04-14 13:39:21 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:

Description Jozef Hartinger 2020-03-26 13:55:21 UTC
Description of problem:

Satellite inventory plugin is sending host data in an invalid format. The value segment of a host tag is expected to be a string (or null). Looks like the sat plugin is sending numbers instead.

See https://kibana-kibana.1b13.insights.openshiftapps.com/app/kibana#/discover?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-12h,mode:quick,to:now))&_a=(columns:!(_source),index:'0a2575c0-65f9-11e9-ba88-097c6c9f6850',interval:auto,query:(language:lucene,query:'@log_stream:+%22inventory-mq-*%22+AND+message:+%22Error+adding+host+%22+AND+host.reporter:+%22yupana%22'),sort:!('@timestamp',desc)) for the full list of occurences.

Comment 3 Jozef Hartinger 2020-03-27 13:18:35 UTC
Example of a conflicting tag: { "namespace": "satellite", "key": "organization_id", "value": 1 }

The value segment of a host tag is expected to be a utf-8 encoded string (or null). A valid tag would therefore be { "namespace": "satellite", "key": "organization_id", "value": "1" }

Comment 4 Jozef Hartinger 2020-03-27 13:20:17 UTC
Since the message consumed by inventory is not valid this prevents inventory from processing the entire message. As a result, the host entry is not created/updated and the message is discarded.

Comment 7 Mirek Długosz 2020-04-03 11:22:13 UTC
I can confirm that JSON file in generated file has string, not integer:

"tags": [{"namespace": "satellite", "key": "organization_id", "value": "1"}]

Parag Kamble verified that report generated on Satellite reaches cloud.redhat.com and is correctly processed. He also saw increase of hosts in Tally, as expected.


Tested on Satellite 6.7 snap 18:
foreman-1.24.1.20-1.el7sat.noarch
satellite-6.7.0-7.el7sat.noarch
pulp-server-2.21.0-1.el7sat.noarch
katello-3.14.0-6.el7sat.noarch
[root@dhcp-3-134 ~]# rpm -qa |grep rh_cloud
tfm-rubygem-foreman_rh_cloud-1.0.4.1-1.el7sat.noarch

Comment 8 Bryan Kearney 2020-04-14 13:39:21 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, 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-2020:1454