Unable to submit results to certification.canonical.com - sortkey attribute not accepted by server

Bug #954423 reported by Daniel Manrique
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
High
Daniel Manrique
OEM QA Checkbox additions
Invalid
High
Unassigned

Bug Description

Result submissions to certification.canonical.com fail with "Inconsistent message" errors on the clientside. Serverside, the message is this:

2012-03-13T19:44:49 ERROR canonical.certify.message Error handling message 'set-distribution' for hardware 201101-6950 (OOPS 2263production38): {'distribution': {'release': '12.04', 'codename': 'precise', 'distributor_id': 'Ubuntu', 'description': 'Ubuntu precise (development branch)', 'sortkey': 0}, 'type': 'set-distribution'}
Traceback (most recent call last):
  File "./src/canonical/certify/message/messageapis.py", line 230, in _run
    self.handle(message["type"], message)
  File "./src/canonical/message/api.py", line 57, in handle
    return handler(type, body)
  File "./src/canonical/checkbox/arguments.py", line 81, in replacement
    kwargs)
  File "./src/canonical/checkbox/arguments.py", line 54, in replace_arguments
    args[name_index] = self.argument_replacer(name, value)
  File "./src/canonical/checkbox/arguments.py", line 74, in replacer
    return schema.coerce(value)
  File "/srv/certification.canonical.com/checkbox/checkbox/properties.py", line 71, in coerce
    return self._variable_class(**self._variable_kwargs).coerce(value)
  File "/srv/certification.canonical.com/checkbox/checkbox/variables.py", line 265, in coerce
    % (attribute, value, e))
ValueError: Value of 'distribution' key of dict {'distribution': {'release': '12.04', 'codename': 'precise', 'distributor_id': 'Ubuntu', 'description': 'Ubuntu precise (development branch)', 'sortkey': 0}, 'type': 'set-distribution'} could not be converted: 'sortkey' is not a valid key as per {'release': <functools.partial object at 0xba72b1c>, 'codename': <functools.partial object at 0xba72b44>, 'distributor_id': <functools.partial object at 0xba72b6c>, 'description': <functools.partial object at 0xba72b94>}

I can see the troublesome part is the "sortkey" element of the distribution dictionary/message. The sortkey attribute is added in code from checkbox revision 1291 to visually sort jobs in the user interface. However, sending these to either c3 or launchpad doesn't make sense.

The possible solution is to strip the sortkey element prior to sending messages, which is done in the launchpad_report and certify_report plugins.

Daniel Manrique (roadmr)
Changed in checkbox-certification:
status: New → Triaged
importance: Undecided → High
summary: - Unable to submit results to certification.canonical.com
+ Unable to submit results to certification.canonical.com - sortkey
+ attribute not accepted by server
Changed in oem-qa-checkbox:
importance: Undecided → High
assignee: nobody → Javier Collado (javier.collado)
Revision history for this message
Daniel Manrique (roadmr) wrote :

Moving this bug to checkbox, as the problem originates in checkbox core and thus that's the best place for a generic solution.

affects: checkbox-certification → checkbox
Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
status: Triaged → In Progress
milestone: none → 0.13.5
visibility: private → public
Revision history for this message
Samantha Jian-Pielak (samantha-jian) wrote :

checkbox-certification-client: 0.13.1~ppa20.12.04
checkbox-oem: 0.44-0-precise1~rev564

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

Ok so this problem has proven a bit more difficult to solve than initially anticipated.

If you don't need the "show tests in job definition order" feature from checkbox rev 1291 and the related fix from rev 1305, a possible workaround is to remove that code from your version of checkbox.

I'll keep looking at this but I don't know when we'll have a viable solution that still maintains the sortkey feature.

Revision history for this message
Javier Collado (javier.collado) wrote :

@Daniel

I think the revisions you're talking about are: 1291 & 1307 (not 1305).

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

Hi Javier,

Yes, you're right, it's 1307. Apologies for the (off by two?) error.

Daniel Manrique (roadmr)
Changed in checkbox:
status: In Progress → Fix Committed
Revision history for this message
Daniel Manrique (roadmr) wrote :

Due to the impact this was having, the fix was to excise revs 1291 and 1307 from trunk. Trunk works now, at the expense of the keep_tests_ordered feature :( I'm working on a reimplementation of this feature.

Ara Pulido (ara)
Changed in checkbox:
status: Fix Committed → Fix Released
Changed in oem-qa-checkbox:
assignee: Javier Collado (javier.collado) → nobody
status: New → Invalid
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.