-
Story
-
Resolution: Done
-
Normal
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
None
-
Unset
-
None
-
-
-
At the moment, HBI fails to report test hosts to Kessel Inventory due to an apparent mismatch between the data reported and the validation rules applied by Kessel Inventory.
ReportResource call: https://github.com/RedHatInsights/insights-host-inventory/blob/kessel-aware/lib/kessel.py#L297
Code that generates test hosts: https://github.com/RedHatInsights/insights-host-inventory/blob/kessel-aware/utils/payloads.py#L583
Sample error from the Kessel Inventory side:
ERROR ts=2025-07-28T20:04:42Z caller=log/helper.go:85 service.name=inventory-api service.version=0.1.0 trace.id= span.id= kind=server component=grpc operation=/kessel.inventory.v1beta2.KesselInventoryService/ReportResource args=type:"host" reporter_type:"hbi" reporter_instance_id:"3c4e2382-26c1-11f0-8e5c-ce0194e9e144" representations:{metadata:
{local_resource_id:"b5c36330-79cf-426e-a950-df2e972c3ef4" api_href:"https://apiHref.com/" console_href:"https://www.consoleHref.com/" reporter_version:"0.1"}common:{fields:{key:"workspace_id" value:
{string_value:"01985285-6136-7bb3-b5bf-9fa8342b4778"}}} reporter:{fields:{key:"ansible_host" value:{null_value:NULL_VALUE}} fields:{key:"insights_inventory_id" value:{string_value:"b5c36330-79cf-426e-a950-df2e972c3ef4"}} fields:{key:"satellite_id" value:{string_value:""}} fields:{key:"subscription_manager_id" value:{string_value:""}}}} code=400 reason=REPORT_RESOURCE_JSON_VALIDATOR stack=error: code = 400 reason = REPORT_RESOURCE_JSON_VALIDATOR message = reporter representation validation failed for 'host:hbi': validation failed: satellite_id: Does not match format 'uuid'; ansible_host: Invalid type. Expected: string, given: null metadata = map[] cause = reporter representation validation failed for 'host:hbi': validation failed: satellite_id: Does not match format 'uuid'; ansible_host: Invalid type. Expected: string, given: null latency=0.000430589
Sample error from the HBI side:
Traceback (most recent call last): File "/opt/app-root/src/./inv_mq_service.py", line 52, in <module> main() File "/opt/app-root/src/./inv_mq_service.py", line 48, in main hbi_consumer.event_loop(shutdown_handler.shut_down) File "/opt/app-root/src/app/queue/host_mq.py", line 224, in event_loop self.post_process_rows() File "/opt/app-root/src/app/queue/host_mq.py", line 375, in post_process_rows db.session.commit() File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/scoping.py", line 599, in commit return self.proxied.commit() File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/session.py", line 2032, in commit trans.commit(_to_root=True) File "<string>", line 2, in commit File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/session.py", line 1313, in commit self._prepare_impl() File "<string>", line 2, in _prepare_impl File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/orm/session.py", line 1276, in _prepare_impl self.session.dispatch.before_commit(self.session) File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/event/attr.py", line 378, in __call_ fn(*args, **kw) File "/opt/app-root/src/lib/kessel.py", line 64, in before_commit client.ReportHost(to_upsert) File "/opt/app-root/src/lib/kessel.py", line 148, in ReportHost self.inventory_svc.ReportResource(request) File "/usr/local/lib64/python3.9/site-packages/grpc/channel.py", line 1181, in __call_ return _end_unary_response_blocking(state, call, False, None) File "/usr/local/lib64/python3.9/site-packages/grpc/_channel.py", line 1006, in _end_unary_response_blocking raise _InactiveRpcError(state) # pytype: disable=not-instantiable grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.INVALID_ARGUMENT details = "reporter representation validation failed for 'host:hbi': validation failed: satellite_id: Does not match format 'uuid'; ansible_host: Invalid type. Expected: string, given: null" debug_error_string = "UNKNOWN:Error received from peer {grpc_status:3, grpc_message:"reporter representation validation failed for \'host:hbi\': validation failed: satellite_id: Does not match format \'uuid\'; ansible_host: Invalid type. Expected: string, given: null"}" >