invalid type stored in mongo meters

Bug #1532661 reported by Ke Vo Danh
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Ilya Tyaptin

Bug Description

I'm using ceilometer 5.0.0 Released 10-15-2015. I'm unable to run "ceilometer statistics -m hardware.network.outgoing.bytes"

The following error is returned:

Invalid input for field/attribute max. Value: '2459165201'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-02d58185-fb9e-4e5a-b84e-4136280a564c)

I'm using:

pymongo (3.2)
ceilometer (5.0.0)
python-ceilometerclient (2.1.0)
MongoDB version: 3.2.0

This does not happen with hardware.system_stats.cpu.idle, hardware.memory.used and some meter and sample-list with this meter.

Revision history for this message
gordon chung (chungg) wrote :

i assume this relates to bug 1474031. i'm marking triaged. feel free to upload a fix :)

Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
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/287993

Changed in ceilometer:
assignee: nobody → Ilya Tyaptin (ityaptin)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit 1d73a6f12f123743e51674b5dbc876bf3d600cd8
Author: Ilya Tyaptin <email address hidden>
Date: Thu Mar 3 20:12:06 2016 +0300

    Cast Int64 values to int, float in statistics

    Currently statistics requests fail with type errors.
    It causes by the fact that pymongo returns bson.Int64
    instead of float or int for big nums. It affects a `cpu`
    meter usually.

    Change-Id: I744a9f79a4bbc3b2ecdd73c126b0859f3f8a733c
    Closes-bug: #1532661

Changed in ceilometer:
status: In Progress → Fix Released
Revision history for this message
Andrea (andrelisci) wrote :

same problem with centos 7 using:

openstack-ceilometer-central-5.0.2-1.el7.noarch
python-ceilometer-5.0.2-1.el7.noarch
openstack-ceilometer-notification-5.0.2-1.el7.noarch
openstack-ceilometer-polling-5.0.2-1.el7.noarch
openstack-ceilometer-collector-5.0.2-1.el7.noarch
openstack-ceilometer-alarm-5.0.2-1.el7.noarch
python-ceilometerclient-1.5.0-1.el7.noarch
openstack-ceilometer-common-5.0.2-1.el7.noarch
openstack-ceilometer-api-5.0.2-1.el7.noarch

mongodb-server-2.6.11-1.el7.x86_64
python-pymongo-3.0.3-1.el7.x86_64
mongodb-2.6.11-1.el7.x86_64

ceilometer statistics -m image.size
Invalid input for field/attribute max. Value: '18253611008'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-ec51fecd-f497-4158-991f-31fb0e98fe7d)

ceilometer statistics -m disk.device.allocation
Invalid input for field/attribute max. Value: '17904262656'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-3acc39e3-f51b-4f10-9a26-e34b6eb9f45a)

ceilometer statistics -m disk.device.capacity
Invalid input for field/attribute max. Value: '21474836480'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-5ea31012-28b2-49ef-b096-43af6c394509)

ceilometer statistics -m disk.device.read.bytes
Invalid input for field/attribute max. Value: '5298231808'. Wrong type. Expected '<type 'float'>', got '<class 'bson.int64.Int64'>' (HTTP 400) (Request-ID: req-ccc8ae13-036d-4dd2-bab1-4f617de282bc)

Mehdi Abaakouk (sileht)
tags: added: liberty-backport-potential
Revision history for this message
Andrea (andrelisci) wrote :

I ported https://review.openstack.org/287993 solution on my liberty python-ceilometer-5.0.2-1.el7.noarch deployment

it seems to works

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/304223

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

Reviewed: https://review.openstack.org/304223
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=af3cb7b5245a572763501502ba33b21a36a26492
Submitter: Jenkins
Branch: stable/liberty

commit af3cb7b5245a572763501502ba33b21a36a26492
Author: Ilya Tyaptin <email address hidden>
Date: Thu Mar 3 20:12:06 2016 +0300

    Cast Int64 values to int, float in statistics

    Currently statistics requests fail with type errors.
    It causes by the fact that pymongo returns bson.Int64
    instead of float or int for big nums. It affects a `cpu`
    meter usually.

    Change-Id: I744a9f79a4bbc3b2ecdd73c126b0859f3f8a733c
    Closes-bug: #1532661
    (cherry picked from commit 1d73a6f12f123743e51674b5dbc876bf3d600cd8)

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/ceilometer 5.0.3

This issue was fixed in the openstack/ceilometer 5.0.3 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.