wsme 0.5b6 is broken

Bug #1240741 reported by gordon chung
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Critical
Julien Danjou
Havana
Fix Released
Critical
Julien Danjou
WSME
Invalid
Critical
Julien Danjou

Bug Description

ceilometer POST tests are failing from what looks like WSME bug.

at https://github.com/stackforge/wsme/blob/master/wsme/rest/json.py#L135, a *** MissingArgument: Missing argument: "counter_volume" error is raised when it tries for whatever reason to create a Sample object.... from there it all falls apart.

-> @generic
(Pdb)
> /opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/wsme/rest/json.py(132)fromjson()
-> if value is None:
(Pdb) args
datatype = <class 'ceilometer.api.controllers.v2.Sample'>
value = {'counter_name': 'apples', 'user_id': 'efd87807-12d2-4b38-9c70-5f5c2ac427ff', 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36', 'counter_unit': 'instance', 'counter_volume': 1, 'project_id': '35b17138-b364-4e6a-a131-8f3099c5be68', 'resource_metadata': {'name2': 'value2', 'name1': 'value1'}, 'counter_type': 'gauge'}
(Pdb) n
> /opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/wsme/rest/json.py(134)fromjson()
-> if wsme.types.iscomplex(datatype):
(Pdb) n
> /opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/wsme/rest/json.py(135)fromjson()
-> obj = datatype()
(Pdb) n
MissingArgument: MissingA...olume"',)
> /opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/wsme/rest/json.py(135)fromjson()
-> obj = datatype()
(Pdb) datatype()
*** MissingArgument: Missing argument: "counter_volume"

Julien Danjou (jdanjou)
Changed in wsme:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Julien Danjou (jdanjou)
Julien Danjou (jdanjou)
Changed in ceilometer:
assignee: nobody → Julien Danjou (jdanjou)
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Julien Danjou (jdanjou) wrote :

On WSME side, the regression comes from

commit 664c214dbf2dd33e8fd6a78ca828c02bb1a91c1c
Author: Mehdi Abaakouk <email address hidden>
Date: Mon Sep 30 17:33:57 2013 +0200

    Handle [] {} for body in rest protocols

    This change allow to use [] or {} for the definition of the body in rest
    protocols.

    Fixes bug #1233219

    Change-Id: Ib96f0487dd7d78bd657f6d4b3facbd8b611f8702

There's also a few things in Ceilometer, related to error messages that may have changed in unit tests.

Revision history for this message
Julien Danjou (jdanjou) wrote :

Ok so I think this is not the problem. I wrote a test case for WSME and it works fine even with Pecan.

I think the problem is that we do extra validation in __init__ in Ceilometer whereas WSME when decoding JSON calls init with no argument and then setattr().

Julien Danjou (jdanjou)
Changed in wsme:
status: Triaged → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52356

Changed in ceilometer:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/52356
Committed: http://github.com/openstack/ceilometer/commit/e4a1a4fcefd4718e057cf8128c9a6c6b7c98ef59
Submitter: Jenkins
Branch: master

commit e4a1a4fcefd4718e057cf8128c9a6c6b7c98ef59
Author: Julien Danjou <email address hidden>
Date: Mon Sep 30 16:43:59 2013 +0200

    api: update for WSME 0.5b6 compliance

    This makes use of the mandatory option of WSME, that now works, to
    remove some of our custom validation code. This is needed for new
    versions of WSME that do more validation on their own.

    Fixes-Bug: #1240741

    Change-Id: Icb66d17066b515bebf3f3a326d84e18cbfce01ef
    Signed-off-by: Julien Danjou <email address hidden>

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/52602

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/54120

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/havana)

Reviewed: https://review.openstack.org/54120
Committed: http://github.com/openstack/ceilometer/commit/b6165624ef1095e979b4e383a84462afb62ec2d0
Submitter: Jenkins
Branch: stable/havana

commit b6165624ef1095e979b4e383a84462afb62ec2d0
Author: Julien Danjou <email address hidden>
Date: Mon Oct 28 14:30:33 2013 +0100

    Limit WSME to working version

    WSME >= 0.5b6 breaks Ceilometer as it has been released in Havana. So
    let's keep WSME with a correct version range.

    Fixes-Bug: #1240741

    Change-Id: Iac8dfa6a7f5506423f467a96ed9ad0c70cbb35c5

Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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