APIv2: 500 when requesting statistics with MongoDB using tools/make_test_data

Bug #1504539 reported by Julien Danjou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
Liusheng

Bug Description

DEBUG (connectionpool) "GET /v2/meters/instance/statistics HTTP/1.1" 500 138
DEBUG (client) RESP: [500] {'Content-Length': '138', 'Server': 'Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5', 'Connection': 'close', 'Date': 'Fri, 09 Oct 2015 13:12:53 GMT', 'Content-Type': 'application/json', 'x-openstack-request-id': 'req-15ef8518-8f18-448a-a3c3-43dcbdf919da'}

DEBUG (client) RESP BODY: {"error_message": {"debuginfo": null, "faultcode": "Server", "faultstring": "unsupported operand type(s) for -: 'unicode' and 'unicode'"}}

DEBUG (client) Request returned failure status: 500

The traceback:

2015-10-09 15:13:14.144553 2015-10-09 15:13:14.144 30586 ERROR wsme.api [-] Server-side error: "unsupported operand type(s) for -: 'unicode' and 'unicode'". Detail:
2015-10-09 15:13:14.144587 Traceback (most recent call last):
2015-10-09 15:13:14.144591
2015-10-09 15:13:14.144594 File "/usr/lib/python2.7/site-packages/wsmeext/pecan.py", line 84, in callfunction
2015-10-09 15:13:14.144596 result = f(self, *args, **kwargs)
2015-10-09 15:13:14.144598
2015-10-09 15:13:14.144601 File "/opt/stack/ceilometer/ceilometer/api/controllers/v2/meters.py", line 415, in statistics
2015-10-09 15:13:14.144603 f, period, g, aggregate)
2015-10-09 15:13:14.144605
2015-10-09 15:13:14.144607 File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py", line 622, in get_meter_statistics
2015-10-09 15:13:14.144619 for point in self._get_results(results)]
2015-10-09 15:13:14.144621
2015-10-09 15:13:14.144625 File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py", line 647, in _stats_result_to_model
2015-10-09 15:13:14.144628 result["first_timestamp"]).total_seconds()
2015-10-09 15:13:14.144631
2015-10-09 15:13:14.144633 TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'

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

The timestamp returned is "2015-10-11T12:04:49.108221"

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

I put data using tools/make_test_data, maybe that's a cause, IDK.

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

This has been introduced by I1520450ae4e82459b73cc411a698a6faa91a40e0

Changed in ceilometer:
status: New → Confirmed
importance: Undecided → Low
summary: - APIv2: 500 when requesting statistics with MongoDB
+ APIv2: 500 when requesting statistics with MongoDB using
+ tools/make_test_data
Liusheng (liusheng)
Changed in ceilometer:
assignee: nobody → Liusheng (liusheng)
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/233375

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

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

commit 2c1227e09d7cedd9f10b21d0c8f18b2ebd03432f
Author: liusheng <email address hidden>
Date: Sat Oct 10 22:04:57 2015 +0800

    Correct the timestamp type when make test samples data

    When recording samples to database, the timestamp should be
    datetime.datetime type, but in make_test_data.py, the timestamp
    will be transformed to iso format with unicode type.

    Change-Id: Iffb09a293684fb8eab768c7370e8967349032ae5
    Closes-Bug: #1504539

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/ceilometer 6.0.0.0b1

This issue was fixed in the openstack/ceilometer 6.0.0.0b1 development milestone.

Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Liusheng (liusheng)
Changed in ceilometer:
milestone: none → mitaka-1
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.