Specifying invalid aggregation method for statistics leads to 500 error

Bug #1570416 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
ZhiQiang Fan

Bug Description

Specifying invalid aggregation method leads to 500 error:
ceilometer --debug statistics -m gabbilive-meter -a mmm
...
INFO (connectionpool) Starting new HTTP connection (1): 192.168.1.13
DEBUG (connectionpool) "GET /v2/meters/gabbilive-meter/statistics?aggregate.func=mmm HTTP/1.1" 500 86
DEBUG (client) RESP: [500] {'date': 'Thu, 14 Apr 2016 14:34:28 GMT', 'content-length': '86', 'content-type': 'application/json', 'x-openstack-request-id': 'req-24cdad7c-8847-4d33-ba7a-4a0031f8c570', 'server': 'Werkzeug/0.9.1 Python/2.7.5'}

DEBUG (client) RESP BODY: {"error_message": {"debuginfo": null, "faultcode": "Server", "faultstring": "u'mmm'"}}

DEBUG (client) Request returned failure status: 500
Traceback (most recent call last):
  File "/bin/ceilometer", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 293, in main
    CeilometerShell().main(args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 242, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 95, in do_statistics
    statistics = cc.statistics.list(**api_args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/statistics.py", line 58, in list
    q, p))
  File "/usr/lib/python2.7/site-packages/ceilometerclient/common/base.py", line 70, in _list
    resp = self.api.get(url)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 355, in get
    return self.client_request("GET", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 345, in client_request
    self, method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 261, in client_request
    method, self.concat_url(endpoint, url), **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 201, in request
    raise exceptions.from_response(resp, method, url)
ceilometerclient.openstack.common.apiclient.exceptions.InternalServerError: u'mmm' (HTTP 500) (Request-ID: req-24cdad7c-8847-4d33-ba7a-4a0031f8c570)

Packages:
openstack-ceilometer-*5.0.2

Regards,
Yurii

Revision history for this message
Sirisha (sirisha-1) wrote :

Hi Yurii Prokulevych,

I am using ceilometer- 2.4.0 and i am getting the following error

ceilometerclient.openstack.common.apiclient.exceptions.HttpNotImplemented: Selectable aggregate function mmm is not supported
which is correct i guess.

please correct me if i am wrong

Regards
Sirisha

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → ZhiQiang Fan (aji-zqfan)
milestone: none → newton-1
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/306530

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

Reviewed: https://review.openstack.org/306530
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=f41d6dd951dffbeea6ff24e0d6f247a034a51178
Submitter: Jenkins
Branch: master

commit f41d6dd951dffbeea6ff24e0d6f247a034a51178
Author: ZhiQiang Fan <email address hidden>
Date: Sat Apr 16 08:20:57 2016 +0800

    return 400 when invalid aggregation function is specified

    When an invalid aggregation function is specified, MongoDB backend
    will raise a 500 KeyError, SQL backend will return a 501 NotImplementedError.
    However, such invalid aggregation functions will not be supported now
    or by schedule. We should return 400 instead.

    Change-Id: I4edeef8e52047d1e7eebd078a9a863ad4101c5fd
    Closes-Bug: #1570416

Changed in ceilometer:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/ceilometer 7.0.0.0b2

This issue was fixed in the openstack/ceilometer 7.0.0.0b2 development milestone.

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.