statistics error: Wrong type. Expected '<type 'float'>'

Bug #1553111 reported by Yurii Prokulevych
This bug report is a duplicate of:  Bug #1532661: invalid type stored in mongo meters. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
New
Undecided
Unassigned
python-ceilometerclient
Invalid
Undecided
Unassigned

Bug Description

While trying to get statistics for 'hardware.disk.size.used' meter got an error:

ceilometer statistics -m hardware.disk.size.used -a sum
Invalid input for field/attribute sum. Value: '181871890384'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-692d8469-c8e1-417a-b749-eb8efe6ac935)

And with '--debug':
ceilometer --debug statistics -m hardware.disk.size.used -a sum [3/175]
DEBUG (session) REQ: curl -g -i -X GET http://192.0.2.6:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 335
DEBUG (session) RESP: [200] date: Fri, 04 Mar 2016 09:46:57 GMT vary: X-Auth-Token content-length: 335 content-type: application/json x-openstack-request-id: req-b27ce672-66a1-4ab0-af0f-e2ada1a1379c
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"hre
f": "http://192.0.2.6:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.0.2.6:5000/v2.0/tokens
DEBUG (connectionpool) "POST /v2.0/tokens HTTP/1.1" 200 4243
DEBUG (session) REQ: curl -g -i -X GET http://192.0.2.6:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 335
DEBUG (session) RESP: [200] date: Fri, 04 Mar 2016 09:46:57 GMT vary: X-Auth-Token content-length: 335 content-type: application/json x-openstack-request-id: req-d85ddf3c-f18d-4486-b84f-84f3b1ed1491
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"hre
f": "http://192.0.2.6:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.0.2.6:5000/v2.0/tokens
DEBUG (connectionpool) "POST /v2.0/tokens HTTP/1.1" 200 4243
DEBUG (client) REQ: curl -g -i -X 'GET' 'http://192.0.2.6:8777/v2/meters/hardware.disk.size.used/statistics?aggregate.func=sum' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: {SHA
1}3a9a7b7e428dd1b81c2549b5ebeb58a145c1241f'
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "GET /v2/meters/hardware.disk.size.used/statistics?aggregate.func=sum HTTP/1.1" 400 213
DEBUG (client) RESP: [400] {'date': 'Fri, 04 Mar 2016 09:47:01 GMT', 'content-length': '213', 'content-type': 'application/json', 'x-openstack-request-id': 'req-e4f9974b-c3f1-482e-9fb5-835e501028be', 'server': '
Werkzeug/0.9.1 Python/2.7.5'}

DEBUG (client) RESP BODY: {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Invalid input for field/attribute sum. Value: '181571884992'. Wrong type. Expected '<type 'float'>', got '<c
lass 'bson.int64.Int64'>'"}}

DEBUG (client) Request returned failure status: 400
Traceback (most recent call last):
  File "/usr/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.BadRequest: Invalid input for field/attribute sum. Value: '181571884992'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400)
 (Request-ID: req-e4f9974b-c3f1-482e-9fb5-835e501028be)

Packages: python-ceilometerclient-1.5.2-1.el7ost.noarch

Regards,
Yurii

Mehdi Abaakouk (sileht)
Changed in python-ceilometerclient:
status: New → Invalid
Revision history for this message
Yurii Prokulevych (yprokule) wrote :

Excerpt from api.log:
2016-03-04 09:56:07.972 11306 DEBUG wsme.api [-] Client-side error: Invalid input for field/attribute sum. Value: '182247054552'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' format_exception /usr/lib/python2.7/site-packages/wsme/api.py:221
2016-03-04 09:56:07.974 11306 INFO werkzeug [-] 192.0.2.13 - - [04/Mar/2016 09:56:07] "GET /v2/meters/hardware.disk.size.used/statistics?aggregate.func=sum HTTP/1.1" 400 -

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.