ceilometer-client cannot get samples by source

Bug #1093580 reported by Brooklyn on 2012-12-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lianhao Lu

Bug Description

run following command in shell:

ceilometer sample-list -c "image" -s "openstack"

 gets HTTPInternalServerError (HTTP 500) error.

The traceback of ceilometer-api:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1701, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 298, in __call__
    return self.app(env, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/stack/ceilometer/ceilometer/api/v1/blueprint.py", line 401, in list_events_by_source
  File "/opt/stack/ceilometer/ceilometer/api/v1/blueprint.py", line 338, in _list_events
    events = list(flask.request.storage_conn.get_raw_events(f))
  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 322, in get_raw_events
  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 103, in make_query_from_filter
    query = query.filter_by(source=event_filter.source)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1211, in filter_by
    for key, value in kwargs.iteritems()]
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/util.py", line 601, in _entity_descriptor
    (description, key)
InvalidRequestError: Entity '<class 'ceilometer.storage.sqlalchemy.models.Meter'>' has no property 'source'

ceilometer-api version: 1
database_connection: mysql
there is data in the database and the source is "openstack"
no authentication error

Nick Barcet (nijaba) on 2012-12-28
Changed in ceilometer:
status: New → Confirmed
importance: Undecided → Medium
Julien Danjou (jdanjou) on 2012-12-28
tags: added: effort-m
Lianhao Lu (lianhao-lu) on 2013-01-04
Changed in ceilometer:
assignee: nobody → Lianhao Lu (lianhao-lu)

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

Changed in ceilometer:
status: Confirmed → In Progress

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

commit e91afeb7aeaa13fcfab3fdc8a9df42d73899712c
Author: Lianhao Lu <email address hidden>
Date: Fri Jan 4 11:54:20 2013 +0800

    Fixed erroneous source filter in SQLAlchemy.

    Also added test cases for source filter. This fixed bug 1093580.

    Change-Id: Ie3d99e7f27064f88196d6b0a7139fba36251b3c0

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-02-21
Changed in ceilometer:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-04-04
Changed in ceilometer:
milestone: grizzly-3 → 2013.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers