memory/info test failing with traceback in Eoan

Bug #1840462 reported by Rod Smith
This bug report is a duplicate of:  Bug #1843063: lshw -json output invalid. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Next Generation Checkbox (CLI)
New
Undecided
Unassigned

Bug Description

In a test run on Eoan pre-release, the memory/info test failed with the following traceback:

ERROR:root:Unable to parse JSON: Expecting ',' delimiter: line 24 column 8 (char 657)
Traceback (most recent call last):
  File "/tmp/nest-_z0cpg8g.440b17a5ec0d6b6a647c77b4732450c74e22a9f9253d55dd13ad0aa9afafc812/memory_compare", line 138, in <module>
    sys.exit(main())
  File "/tmp/nest-_z0cpg8g.440b17a5ec0d6b6a647c77b4732450c74e22a9f9253d55dd13ad0aa9afafc812/memory_compare", line 101, in main
    installed_memory = HumanReadableBytes(get_installed_memory_size())
  File "/tmp/nest-_z0cpg8g.440b17a5ec0d6b6a647c77b4732450c74e22a9f9253d55dd13ad0aa9afafc812/memory_compare", line 62, in get_installed_memory_size
    lshw.run(result)
  File "/usr/lib/python3/dist-packages/checkbox_support/parsers/lshwjson.py", line 47, in run
    self._parse_lshw(lshw, result)
UnboundLocalError: local variable 'lshw' referenced before assignment

This is from a test on jehan in 18T:

https://certification.canonical.com/hardware/201802-26109/submission/149154/

I'm running another Eoan test on another system now.

Revision history for this message
Rod Smith (rodsmith) wrote :

This seems to be a bug either in the "lshw -json" output or in the Python json module's ability to parse said output. In particular, there's been a change in the output with Eoan. Previous versions produce something like this:

  "capabilities" : {
    "smbios-2.7" : "SMBIOS version 2.7",
    "dmi-2.7" : "DMI version 2.7",
    "vsyscall32" : "32-bit processes"
  },
  "children" : [
    {
      "id" : "core",
      "class" : "bus",

In Eoan, the equivalent segment looks like this:

  "capabilities" : {
    "smbios-2.7" : "SMBIOS version 2.7",
    "dmi-2.7" : "DMI version 2.7",
    "smp" : "Symmetric Multi-Processing",
    "vsyscall32" : "32-bit processes"
  } {
      "id" : "core",
      "class" : "bus",

I'm making inquiries to try to determine whether the new JSON output is valid or not, which will determine whether to file a bug against lshw or the Python json library.

Revision history for this message
Rod Smith (rodsmith) wrote :

Upon consulting with Sylvain, it looks like this is a bug in lshw's JSON output, so I've filed bug #1843063 against lshw. I'm marking this bug as a duplicate, since fixing the lshw output SHOULD resolve this bug. If a fix to lshw doesn't appear before 20.04's release, though, we may need to implement a workaround.

Revision history for this message
Rod Smith (rodsmith) wrote :

Per comments on bug #1843063, a fix has been identified. I've tested it in Checkbox's memory/info test, and it works fine, so I'm hoping it will be merged into Ubuntu's lshw before the release of 20.04.

Revision history for this message
Rod Smith (rodsmith) wrote :

See also bug #1857129.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.