Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-89566

[RHEL 8.x] Malformed JSON in lshw output under RHEL8

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Critical Critical
    • rhel-8.10
    • rhel-8.10
    • lshw
    • No
    • Low
    • ZStream
    • rhel-kernel-debug
    • ssg_core_kernel
    • 12
    • 2
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Approved Blocker
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      When running the lshw command with the -json option on a RHEL8 system, the JSON output is malformed. This issue affects the ability to automatically parse hardware information, which is crucial for various system management and monitoring tasks.

      What is the impact of this issue to you/customer?

      The malformed JSON output from the lshw command significantly impacts our business operations in the following ways:

      Compliance and Auditing: Accurate hardware inventory is essential for compliance and auditing purposes. The malformed JSON output compromises our ability to maintain an up-to-date and accurate hardware inventory, which can lead to compliance violations.

      Please provide the package NVR for which the bug is seen:

      [root@localhost ~]# rpm -aq | grep lshw
      lshw-B.02.19.2-6.el8.x86_64

      How reproducible is this bug?:

      Upon further checking with and comparing the outputs with RHEL 8 and RHEL 9/10

      ~~~
      [root@rhel8 ~]# cat /etc/redhat-release
      Red Hat Enterprise Linux release 8.10 (Ootpa)
      [root@rhel8 ~]# lshw -C display -json
      {
      "id" : "display",
      "class" : "display",
      "claimed" : true,
      "handle" : "PCI:0000:00:01.0",
      "description" : "VGA compatible controller",
      "product" : "Virtio 1.0 GPU",
      "vendor" : "Red Hat, Inc.",
      "physid" : "1",
      "businfo" : "pci@0000:00:01.0",
      "logicalname" : "/dev/fb0",
      "version" : "01",
      "width" : 64,
      "clock" : 33000000,
      "configuration" :

      { "depth" : "32", "driver" : "virtio-pci", "latency" : "0", "resolution" : "1280,800" }

      ,
      "capabilities" : {
      "msix" : "MSI-X",
      "vga_controller" : true,
      "bus_master" : "bus mastering",
      "cap_list" : "PCI capabilities listing",
      "rom" : "extension ROM",
      "fb" : "framebuffer"
      },
      "children" : [

      ]
      },
      [root@rhel8 ~]# lshw -C display -json &> /tmp/lshw.json  

      [root@rhel8 ~]# jq empty /tmp/lshw.json && echo "Valid JSON" || echo "Malformed JSON"
      parse error: Expected value before ',' at line 32, column 4
      Malformed JSON
      ~~~
       

      Expected results:

      When we verifty the lshw.json file it should return "Valid JSON"
      root@rhel8:~# jq empty /tmp/lshw.json && echo "Valid JSON" || echo "Malformed JSON"
      Valid JSON

      Actual results:

       
      [root@rhel8 ~]# jq empty /tmp/lshw.json && echo "Valid JSON" || echo "Malformed JSON"
      parse error: Expected value before ',' at line 32, column 4
      Malformed JSON

              ltao@redhat.com Liu Tao
              rhn-support-rdulhani Rajesh Dulhani
              Liu Tao Liu Tao
              Jeffrey Bastian Jeffrey Bastian
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: