Satellite 6 inventory sync fails in Ansible Automation Platform with "TypeError: the JSON object must be str, bytes or bytearray, not list" in redhat.satellite foreman plugin

Solution Verified - Updated -

Issue

  • Satellite 6 inventory synchronization fails in Automation Controller when the inventory source uses the satellite6 (foreman) plugin and the Reports API.

    [WARNING]: * Failed to parse /runner/inventory/foreman.yml with auto plugin:
    the JSON object must be str, bytes or bytearray, not list
    File ".../redhat/satellite/plugins/inventory/foreman.py", line 438, in _post_request
        self._cache[self.cache_key][url] = json.loads(response.json())
    TypeError: the JSON object must be str, bytes or bytearray, not list
    
  • The failure occurs during inventory update jobs that call the Satellite Ansible Inventory report (report_data) path. Inventory sources that do not set use_reports_api: false use this path by default.

Environment

  • Red Hat Ansible Automation Platform 2.5, 2.6, 2.7
  • Red Hat Satellite 6.19
  • Execution environment: ee-supported-rhel9 (or equivalent)
  • Affected collection: redhat.satellite earlier than 5.13.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content