Creating alarm with a maching_metadata with dot in key failed

Bug #1201886 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Mehdi Abaakouk

Bug Description

Creating alarm with a maching_metadata with dot in key failed:

2013-07-16 16:59:30.675 30239 ERROR wsme.api [-] Server-side error: "not okForStorage". Detail:
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 70, in callfunction
    result = f(self, *args, **kwargs)

  File "/vagrant/stack-master/ceilometer/ceilometer/api/controllers/v2.py", line 836, in post
    alarm = conn.update_alarm(alarm_in)

  File "/vagrant/stack-master/ceilometer/ceilometer/storage/impl_mongodb.py", line 651, in update_alarm
    upsert=True)

  File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 479, in update
    check_keys, self.__uuid_subtype), safe)

  File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 920, in _send_message
    rv = self.__check_response_to_last_error(response)

  File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 863, in __check_response_to_last_error
    raise OperationFailure(details["err"], details["code"])

OperationFailure: not okForStorage

xingzhou (xingzhou)
Changed in ceilometer:
assignee: nobody → xingzhou (xingzhou)
Revision history for this message
xingzhou (xingzhou) wrote :

@Mehdi, for mongodb naming rules, dot can not be used for a key field, this causes the storage of alarm failed. I'm thinking user shall avoid using name with a ".", is there any special cases that must use dot in the name? what's your idea?

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Confirmed
importance: Undecided → High
milestone: none → havana-3
Revision history for this message
Mehdi Abaakouk (sileht) wrote :

A sample can have many depths of dict in the metadata fields, specially for nova meters.

And for Heat Autoscaling we need to filter on a nova metadata for catch all instances in a autoscaling group.

This is why dot must be allow in matching_metadata in the alarm.

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/37641

Changed in ceilometer:
assignee: xingzhou (xingzhou) → Mehdi Abaakouk (sileht)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit a958d6c2cebc03638100364765e6f3a6ced984ff
Author: Mehdi Abaakouk <email address hidden>
Date: Thu Jul 18 10:22:32 2013 +0200

    Implement dot in matching_metadata key for mongodb

    Before the dict matching_metadata was stored as dict in mongo.
    But mongo doesn't allow dot in dictionary key

    This change converts the matching_metadata dict into a array like this:

    [ { 'key': 'info.key.dotted', 'value': 'the_value'} ]

    Fixes bug #1201886

    Change-Id: Iab94c675749331ff7bfb0f74728dbd8f947f26f6

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-3 → 2013.2
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.