ceilometer resource-list and ceilometer meter-list raise exception because of wrong resource_id type

Bug #1280933 reported by zhangjialong
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Low
Ananya Chatterjee

Bug Description

I got an exception when i execute ceilometer resource-list and ceilometer meter-list.

The follows are log of error:

2014-02-17 10:41:11.753 27899 ERROR wsme.api [-] Server-side error: "resource_id: Wrong type. Expected '
<type 'unicode'>', got '<type 'int'>'". Detail:
Traceback (most recent call last):

  File "/usr/lib/python2.6/site-packages/wsmeext/pecan.py", line 72, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 966, in get_all
    for r in pecan.request.storage_conn.get_resources(**kwargs)]

  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 135, in from_db_and_lin
ks
    return cls(links=links, **(m.as_dict()))

  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 908, in __init__
    super(Resource, self).__init__(metadata=metadata, **kwds)
  File "/usr/lib/python2.6/site-packages/wsme/types.py", line 345, in __set__
    raise ValueError("%s: %s" % (self.name, e))

ValueError: resource_id: Wrong type. Expected '<type 'unicode'>', got '<type 'int'>'

Then, i found the data in mongodb like this:
{
  "_id" : ObjectId("5301768f594c106d138ad958"),
  "counter_name" : "ip.floating",
  "user_id" : null,
  "message_signature" : "dc1b2936c40e222fdb1c697902e6d9ca6f723def78c4bff75839e00fe346fcb3",
  "timestamp" : ISODate("2014-02-17T02:40:15.914Z"),
  "resource_id" : 11,
  "resource_metadata" : {
    "pool" : "nova",
    "address" : "192.168.7.11"
  },
  "source" : "openstack",
  "counter_unit" : "ip",
  "counter_volume" : 1,
  "project_id" : null,
  "message_id" : "d527eede-977c-11e3-96c6-c83a35d203f9",
  "counter_type" : "gauge"
}

I`m sure this error occured because of the resource_id .

The version of ceilometer i used is havana.

Changed in ceilometer:
assignee: nobody → shihanzhang (shihanzhang)
Revision history for this message
gordon chung (chungg) wrote :

what's the cli command you are using?

Revision history for this message
zhangjialong (zhangjl) wrote :

I used the commands like follows

ceilometer meter-list

ceiloleter resource-list

Revision history for this message
Zhenshi Zhou (joker-zhou) wrote :

I have the same issue on Centos-6.3 with ceilometer-2013.2.1 and python-ceilometercilent-1.0.8

gordon chung (chungg)
Changed in ceilometer:
status: New → Incomplete
status: Incomplete → Triaged
tags: added: havana-backport-potential
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Medium
Revision history for this message
Koteswara Rao Kelam (koti-kelam) wrote :

I am also facing this issue in my ceilometer icehouse GA setup. If I uninstall mongodb and install it again then it started working fine.
# ceilometer meter-list
WARNING (http:172) Request returned failure status.
HTTPBadRequest (HTTP 400)

In ceilometer-api.log I can see following warning. Did you root caused this issue and have the solution? I can see the defect status as “Traiged” in Launchpad.

2014-05-07 16:31:15.694 6982 INFO keystoneclient.middleware.auth_token [-] Starting keystone auth_token middleware
2014-05-07 16:31:15.703 6982 INFO keystoneclient.middleware.auth_token [-] Using /tmp/keystone-signing-2kxRJJ as cache directory for signing certificate
2014-05-07 16:31:16.037 6982 INFO keystoneclient.middleware.auth_token [-] Starting keystone auth_token middleware
2014-05-07 16:31:16.038 6982 INFO keystoneclient.middleware.auth_token [-] Using /tmp/keystone-signing-ygl82c as cache directory for signing certificate
2014-05-07 16:31:33.068 6982 INFO keystoneclient.middleware.auth_token [-] Auth Token confirmed use of v2.0 apis
2014-05-07 16:31:33.187 6982 WARNING wsme.api [-] Client-side error: Invalid input for field/attribute resource_id. Value: 'True'. Wrong type. Expected '<type 'unicode'>', got '<type 'bool'>'
2014-05-07 16:41:00.379 6982 WARNING wsme.api [-] Client-side error: Invalid input for field/attribute resource_id. Value: 'True'. Wrong type. Expected '<type 'unicode'>', got '<type 'bool'>'

Regards,
Koteswar

Revision history for this message
zhangjialong (zhangjl) wrote :

In my openstack, if i reinstall mongodb, ceilometer can run well just a minute and then go bad . The temporary solution i used is to delete the floatingip but it is not the perfect. I tried to find better but faild

Revision history for this message
Liusheng (liusheng) wrote :

How to reproduce this issue? this bug only exist in icehouse? in my devstack(with mongodb as storage backend), I can't reproduce:(

Revision history for this message
zhangjialong (zhangjl) wrote :

@Liusheng, Sorry for late reply. If you want to reproduce, please use nova-network ,and add floating ips. Then maybe, you can find the error above. By the way , the version of openstack i used is havana.

Changed in ceilometer:
assignee: shihanzhang (shihanzhang) → nobody
ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: ZhiQiang Fan (aji-zqfan) → nobody
Revision history for this message
panfengyun (panfy-fnst) wrote :

@Koteswara Rao Kelam (koti-kelam)
when run 'ceilometer meter-list' and 'ceilometer resource-list':
 WARNING wsme.api [-] Client-side error: Invalid input for field/attribute resource_id. Value: 'True'. Wrong type. Expected '<type 'unicode'>', got '<type 'bool'>'
my openstack is icehouce. Is it the problem of mongodb?

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

i believe the issue is more that the resource_id is an int but we expect a string.

Changed in ceilometer:
importance: Medium → Low
gordon chung (chungg)
tags: removed: havana-backport-potential
Changed in ceilometer:
assignee: nobody → Ananya Chatterjee (ananya23d)
Revision history for this message
Ananya Chatterjee (ananya23d) wrote :

I am unable to reproduce this bug in Liberty. No such error in api.log

summary: ceilometer resource-list and ceilometer meter-list raise exception
- because of wrong resource_id tpye
+ because of wrong resource_id type
gordon chung (chungg)
Changed in ceilometer:
status: Triaged → Invalid
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.