Bug 1817521 - Host data sent to cloud.redhat.com inventory in invalid format
Summary: Host data sent to cloud.redhat.com inventory in invalid format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.7.0
Assignee: Shimon Shtein
QA Contact: Mirek Długosz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-26 13:55 UTC by Jozef Hartinger
Modified: 2020-04-14 13:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:39:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_rh_cloud pull 151 0 None closed BZ 1817521 Make org id tag string 2020-04-30 11:53:08 UTC

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


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