xlsx exporter crashes on non-perfect package resource data

Bug #1402612 reported by Ara Pulido
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PlainBox (Toolkit)
Fix Released
Medium
Sylvain Pineau

Bug Description

I am running canonical-hw-collection from the dev PPA

Two jobs were wrongly skipped:

ID: 2013.com.canonical.certification::device
Category: 2013.com.canonical.plainbox::uncategorised
Job cannot be started because:
 - resource expression 'package.name == "udev"' evaluates to false
Outcome: job cannot be started

ID: 2013.com.canonical.certification::lsb
Category: 2013.com.canonical.plainbox::uncategorised
Job cannot be started because:
 - resource expression 'package.name == "lsb-release"' evaluates to false
Outcome: job cannot be started

(but both packages are installed).

Also, at the end, it crashes:

CRITICAL plainbox.crashes: Executable 'checkbox-launcher' invoked with Namespace(color=None, command=<checkbox_ng.commands.launcher.LauncherCommand object at 0x7ff45fe8e7b8>, debug_console=False, debug_interrupt=False, dont_suppress_output=False, dry_run=False, launcher='/usr/bin/canonical-hw-collection', log_level=None, non_interactive=False, pdb=False, trace=[]) has crashed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 548, in dispatch_and_catch_exceptions
    return self.dispatch_command(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 544, in dispatch_command
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/launcher.py", line 87, in invoked
    ).run()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 114, in run
    return self.do_normal_sequence()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 167, in do_normal_sequence
    self.export_and_send_results()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 344, in export_and_send_results
    exporter.dump(data_subset, stream)
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/xlsx.py", line 683, in dump
    self.write_systeminfo(data)
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/xlsx.py", line 333, in write_systeminfo
    [pkg['name'], pkg['version']],
KeyError: 'version'
Traceback (most recent call last):
  File "/usr/bin/checkbox-launcher", line 9, in <module>
    load_entry_point('checkbox-ng==0.16.dev', 'console_scripts', 'checkbox-launcher')()
  File "/usr/lib/python3/dist-packages/checkbox_ng/main.py", line 62, in launcher
    raise SystemExit(CheckboxLauncherTool().main(argv))
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 323, in main
    return self.dispatch_and_catch_exceptions(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 548, in dispatch_and_catch_exceptions
    return self.dispatch_command(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 544, in dispatch_command
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/launcher.py", line 87, in invoked
    ).run()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 114, in run
    return self.do_normal_sequence()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 167, in do_normal_sequence
    self.export_and_send_results()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/newcli.py", line 344, in export_and_send_results
    exporter.dump(data_subset, stream)
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/xlsx.py", line 683, in dump
    self.write_systeminfo(data)
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/xlsx.py", line 333, in write_systeminfo
    [pkg['name'], pkg['version']],
KeyError: 'version'
Exception ignored in: <bound method Workbook.__del__ of <xlsxwriter.workbook.Workbook object at 0x7ff45c4cb208>>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xlsxwriter/workbook.py", line 127, in __del__
    self.close()
  File "/usr/lib/python3/dist-packages/xlsxwriter/workbook.py", line 237, in close
    self._store_workbook()
  File "/usr/lib/python3/dist-packages/xlsxwriter/workbook.py", line 420, in _store_workbook
    xlsx_file.write(os_filename, xml_filename)
  File "/usr/lib/python3.4/zipfile.py", line 1343, in write
    zinfo.header_offset = self.fp.tell() # Start of header bytes
ValueError: I/O operation on closed file
Exception ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7ff45c12f5c0>>
Traceback (most recent call last):
  File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
    self.close()
  File "/usr/lib/python3.4/zipfile.py", line 1468, in close
    pos1 = self.fp.tell()
ValueError: I/O operation on closed file

Versions:
canonical-hw-collection:
  Installed: 0.13+bzr3503+pkg44~ubuntu14.04.1
  Candidate: 0.13+bzr3503+pkg44~ubuntu14.04.1
  Version table:
 *** 0.13+bzr3503+pkg44~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.12~ppa~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/hardware-certification/public/ubuntu/ trusty/main amd64 Packages
ara@sushirider:~$ apt-cache policy plainbox
plainbox:
  Installed: 0.18+bzr3503+pkg20~ubuntu14.04.1
  Candidate: 0.18+bzr3503+pkg20~ubuntu14.04.1
  Version table:
 *** 0.18+bzr3503+pkg20~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.17.1~ppa~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/hardware-certification/public/ubuntu/ trusty/main amd64 Packages
     0.5.3-2 0
        500 http://es.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

Related branches

Revision history for this message
Ara Pulido (ara) wrote :

Attaching the session

Changed in plainbox-provider-canonical-certification:
importance: Undecided → Critical
Changed in plainbox-provider-canonical-certification:
assignee: nobody → Sylvain Pineau (sylvain-pineau)
status: New → In Progress
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

99% this is a dupe of https://bugs.launchpad.net/plainbox/+bug/1401996

To confirm, look at IO log records from the package job and see if they are not based on distinct lines

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

13:38 <@zyga> spineau: actually, it's not a dupe :)
13:39 <@zyga> ara_: hey, you've reported that bug
13
:39 <@zyga> ara_: where did you run it?
13:39 <@zyga> https://bugs.launchpad.net/plainbox-provider-canonical-certification/+bug/1402612
13:39 <@zyga> ara_: that system didn't have udev installed (!?!)
13:40 <@zyga> then I presume the exporter assumes too much and really does crash on stuff that's not available
13:40 <@zyga> no, wait
13:40 <@zyga> I'm blind
13:40 <@zyga> this is the same as the bug that's still open
13:40 <@zyga> .stdout is not complete
13:40 <@zyga> it's truncated (consistently)
13:41 <@zyga> (i've decoded .record.gz and compared it to stdout)
13:41 <@zyga> what happens here is that we assume that for each package, name and version exits
13:41 <@zyga> that's worth fixing but not tragic
13:41 <@zyga> the weird problem is how that happens in the first place

summary: - Several errors while running canonical-hw-collection from checkbox-dev
+ xlsx exporter crashes on non-perfect package resource data
affects: plainbox-provider-canonical-certification → plainbox
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm demoting the severity of this bug based on further research:

15:01 <@zyga> spineau, ara_: https://bugs.launchpad.net/plainbox/+bug/1402675 this is the bug ara reported
15:01 <@zyga> spineau: well, the real cause
15:01 <@zyga> spineau: let's keep the bug that ara reported for xlsx exporter bug that mishandles non-perfect data

The actually important bug is https://bugs.launchpad.net/plainbox/+bug/1402675

Changed in plainbox:
importance: Critical → Medium
Zygmunt Krynicki (zyga)
Changed in plainbox:
status: In Progress → Confirmed
Changed in plainbox:
status: Confirmed → In Progress
milestone: none → 0.26
Changed in plainbox:
status: In Progress → Fix Committed
Pierre Equoy (pieq)
Changed in plainbox:
status: Fix Committed → Fix Released
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.