canonical-certification-server: KeyError: 'package'

Bug #1293733 reported by Daniel Manrique
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Next Generation Checkbox (CLI)
Fix Released
Critical
Daniel Manrique

Bug Description

This happens only with canonical-certification-server 0.17.8.1, the version in the daily PPA (from trunk) gives a different error

Steps to reproduce:

1- Start with a fresh install of trusty server
2- sudo add-apt-repository ppa:hardware-certification/public; sudo apt-get update
3- sudo apt-get install canonical-certification-server
4- confirm the installed version is 0.17.8.1.
5- run canonical-certification-server
6- select "Continue" in the welcome screen, then "OK" in the suite selection screen (which should preselect the server-selftest-14.04 whitelist)

Expected results:
- Test run starts

Actual result:
Trace as seen here:

==========================[ Loading Jobs Definition ]===========================
Executable 'checkbox' invoked with Namespace(c3_url='https://certification.canonical.com/submissions/submit/', check_config=False, checkbox=None, command=<checkbox_ng.commands.certification.CertificationCommand object at 0x7fb6569026d8>, debug_console=False, debug_interrupt=False, exclude_pattern_list=[], include_pattern_list=[], log_level=None, not_interactive=False, pdb=False, secure_id=None, trace=[], whitelist=[]) has crashed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 491, in dispatch_and_catch_exceptions
    return self.dispatch_command(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 487, in dispatch_command
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/certification.py", line 132, in invoked
    self.settings, ns).run()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 554, in run
    self._run_jobs(ns, manager)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 646, in _run_jobs
    self._run_jobs_with_session(ns, manager, runner)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 765, in _run_jobs_with_session
    if (manager.state.job_state_map[job.name].result.outcome
KeyError: 'package'
Traceback (most recent call last):
  File "/usr/bin/canonical-certification-server", line 9, in <module>
    load_entry_point('checkbox-ng==0.1', 'console_scripts', 'canonical-certification-server')()
  File "/usr/lib/python3/dist-packages/checkbox_ng/main.py", line 192, in cert_server
    CertificationNGTool().main(['certification-server'] + args))
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 285, in main
    return self.dispatch_and_catch_exceptions(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 491, in dispatch_and_catch_exceptions
    return self.dispatch_command(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 487, in dispatch_command
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/certification.py", line 132, in invoked
    self.settings, ns).run()
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 554, in run
    self._run_jobs(ns, manager)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 646, in _run_jobs
    self._run_jobs_with_session(ns, manager, runner)
  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 765, in _run_jobs_with_session
    if (manager.state.job_state_map[job.name].result.outcome
KeyError: 'package'

Revision history for this message
Daniel Manrique (roadmr) wrote :

Marking as confirmed, since this was reported by Kent Baxley and then confirmed by me (the repro case is reliable).

Changed in checkbox:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 2014-mar-28
Revision history for this message
Kent Baxley (kentb) wrote :

This looks like the commit that broke it:

http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/revision/2775.2.1

If I change job.name to job.id in that cli.py file, then I no longer get the key error.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks kent, we seem to have reached the same conclusion :) We're moving everything to use job.id so apparently some component got left behind, I'm now trying to figure out which one it was, and how best to fix it.

Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Kent,

Unfortunately the 0.17.8.1 appears to have "cut" some of our components (checkbox-ng and friends) in a bad place, where some parts (plainbox maybe?) were already using id but others (checkbox-ng) hadn't been yet updated. Latest python3-checkbox-ng, checkbox-ng and plainbox-provider-certification-server all use job.id consistently in place of job.name, and thus they don't crash, plus they also have the correct provider names which fix https://bugs.launchpad.net/checkbox/+bug/1293644.

I've also noticed that canonical-certification-server is conflicting with checkbox-ng, I'll have this sorted out by the time the next stable release is out in about 10 days.

For now I suggest using 0.17.6 if possible, it should be stable and the components fit well together.

The other alternative is tracking the daily builds in the ppa:checkbox-dev/ppa repository, though those are known not to work entirely at the moment (they also don't crash, which is a plus).

I'll leave this bug open until we have a combination that actually works, hopefully in the next couple of days.

Revision history for this message
Kent Baxley (kentb) wrote :

Thanks for the info! Do you know where I can get a copy of 0.17.6? I can't seem to find it in the public ppa anymore. I thought I had a copy but I don't.

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

This is now fixed in trunk.

Changed in checkbox:
status: Confirmed → Fix Committed
Zygmunt Krynicki (zyga)
Changed in plainbox-provider-resource:
milestone: none → 0.3
status: New → Fix Committed
importance: Undecided → Critical
assignee: nobody → Zygmunt Krynicki (zkrynicki)
no longer affects: plainbox-provider-resource
Zygmunt Krynicki (zyga)
affects: checkbox → checkbox-ng
Changed in checkbox-ng:
milestone: 2014-mar-28 → none
Daniel Manrique (roadmr)
Changed in checkbox-ng:
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.