Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ceilometer AttributeError: 'unicode' object has no attribute 'iteritems'

Hi!

I installed ceilometer in our lab environment. When I try to open the resource usage on dashboard, or do a list command with cli I've got the following error:

AttributeError: 'unicode' object has no attribute 'iteritems'

CLI debug output:

ubuntu@kvm5:~$ ceilometer -d meter-list
DEBUG (session) REQ: curl -g -i -X GET http://vip.mgmt.lab.intra:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG (session) RESP: [200] content-length: 352 x-distribution: Ubuntu vary: X-Auth-Token server: Apache/2.4.7 (Ubuntu) date: Mon, 11 Jan 2016 09:46:09 GMT content-type: application/json x-openstack-request-id: req-ab856ae4-7852-4870-89ab-0e3417328c51
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": [{"href": "http://vip.mgmt.lab.intra:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://vip.mgmt.lab.intra:5000/v2.0/tokens
DEBUG (client) REQ: curl -g -i -X 'GET' 'http://vip.mgmt.lab.intra:8777/v2/meters' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: {SHA1}99a5695572cb65bb5d4886d168349704a333d7e0'
DEBUG (client) RESP: [300] CaseInsensitiveDict({'date': 'Mon, 11 Jan 2016 09:46:10 GMT', 'content-length': '133', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-35942073-9987-4e4c-ac16-2677020ba0c9'})

DEBUG (client) RESP BODY: {"versions": [{"status": "CURRENT", "id": "v1.0", "links": [{"href": "http://vip.mgmt.lab.intra:8777/v1/", "rel": "self"}]}]}

Traceback (most recent call last):
  File "/usr/bin/ceilometer", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/shell.py", line 297, in main
    CeilometerShell().main(args)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/shell.py", line 246, in main
    args.func(client, args)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/shell.py", line 234, in do_meter_list
    meters = cc.meters.list(q=options.cli_to_array(args.query))
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/meters.py", line 30, in list
    return self._list(options.build_url(path, q))
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/common/base.py", line 85, in _list
    return [obj_class(self, res, loaded=True) for res in data if res]
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 458, in __init__
    self._add_details(info)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 479, in _add_details
    for (k, v) in six.iteritems(info):
  File "/usr/lib/python2.7/dist-packages/six.py", line 576, in iteritems
    return iter(d.iteritems(**kw))
AttributeError: 'unicode' object has no attribute 'iteritems'

It's very strange that in the last response the API version seems to be v1.0 but it's deprecated and the requests go to V2 so I really don't understand what is going on.

My config file without the passwords:

[DEFAULT]
verbose = False
debug = True

auth_strategy = keystone

[api]

port = 8777
host = 192.168.56.20


[coordination]

backend_url = redis://controller1.mgmt.lab.intra:26379?sentinel=telemetry_cluster&sentinel_fallback=controller3.mgmt.lab.intra:26379&sentinel_fallback=controller2.mgmt.lab.intra:26379
heartbeat = 3.0


[database]

metering_time_to_live = 604800
event_time_to_live = 604800
mongodb_replica_set = openstackrs
connection = mongodb://ceilometer:**************@controller1.mgmt.lab.intra:27017,controller3.mgmt.lab.intra:27017,controller2.mgmt.lab.intra:27017/ceilometer


[keystone_authtoken]


auth_uri = http://vip.mgmt.lab.intra:5000/v2.0
identity_uri = http://vip.mgmt.lab.intra:35357
admin_tenant_name = service
admin_user = ceilometer
admin_password = **********

[notification]

disable_non_metric_meters = true

workload_partitioning = true

[oslo_messaging_rabbit]

rabbit_hosts = controller1.mgmt.lab.intra:5672,controller3.mgmt.lab.intra:5672,controller2.mgmt.lab.intra:5672
rabbit_userid = openstack
rabbit_password = **************
kombu_reconnect_delay=5.0

[publisher]

telemetry_secret = **********


[service_credentials]

os_username = ceilometer
os_password = ********
os_tenant_name = service
os_auth_url = http://vip.mgmt.lab.intra:5000/v2.0
os_region_name = labor
os_endpoint_type = internalURL

Ceilometer AttributeError: 'unicode' object has no attribute 'iteritems'

Hi!

I installed ceilometer in our lab environment. When I try to open the resource usage on dashboard, or do a list command with cli I've got the following error:

AttributeError: 'unicode' object has no attribute 'iteritems'

CLI debug output:

ubuntu@kvm5:~$ ceilometer -d meter-list
DEBUG (session) REQ: curl -g -i -X GET http://vip.mgmt.lab.intra:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG (session) RESP: [200] content-length: 352 x-distribution: Ubuntu vary: X-Auth-Token server: Apache/2.4.7 (Ubuntu) date: Mon, 11 Jan 2016 09:46:09 GMT content-type: application/json x-openstack-request-id: req-ab856ae4-7852-4870-89ab-0e3417328c51
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": [{"href": "http://vip.mgmt.lab.intra:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://vip.mgmt.lab.intra:5000/v2.0/tokens
DEBUG (client) REQ: curl -g -i -X 'GET' 'http://vip.mgmt.lab.intra:8777/v2/meters' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: {SHA1}99a5695572cb65bb5d4886d168349704a333d7e0'
DEBUG (client) RESP: [300] CaseInsensitiveDict({'date': 'Mon, 11 Jan 2016 09:46:10 GMT', 'content-length': '133', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-35942073-9987-4e4c-ac16-2677020ba0c9'})

DEBUG (client) RESP BODY: {"versions": [{"status": "CURRENT", "id": "v1.0", "links": [{"href": "http://vip.mgmt.lab.intra:8777/v1/", "rel": "self"}]}]}

Traceback (most recent call last):
  File "/usr/bin/ceilometer", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/shell.py", line 297, in main
    CeilometerShell().main(args)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/shell.py", line 246, in main
    args.func(client, args)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/shell.py", line 234, in do_meter_list
    meters = cc.meters.list(q=options.cli_to_array(args.query))
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/meters.py", line 30, in list
    return self._list(options.build_url(path, q))
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/common/base.py", line 85, in _list
    return [obj_class(self, res, loaded=True) for res in data if res]
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 458, in __init__
    self._add_details(info)
  File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 479, in _add_details
    for (k, v) in six.iteritems(info):
  File "/usr/lib/python2.7/dist-packages/six.py", line 576, in iteritems
    return iter(d.iteritems(**kw))
AttributeError: 'unicode' object has no attribute 'iteritems'

It's very strange that in the last response the API version seems to be v1.0 but it's deprecated and the requests go to V2 so I really don't understand what is going on.

My config file without the passwords:

[DEFAULT]
verbose = False
debug = True

auth_strategy = keystone

[api]

port = 8777
host = 192.168.56.20


[coordination]

backend_url = redis://controller1.mgmt.lab.intra:26379?sentinel=telemetry_cluster&sentinel_fallback=controller3.mgmt.lab.intra:26379&sentinel_fallback=controller2.mgmt.lab.intra:26379
heartbeat = 3.0


[database]

metering_time_to_live = 604800
event_time_to_live = 604800
mongodb_replica_set = openstackrs
connection = mongodb://ceilometer:**************@controller1.mgmt.lab.intra:27017,controller3.mgmt.lab.intra:27017,controller2.mgmt.lab.intra:27017/ceilometer


[keystone_authtoken]


auth_uri = http://vip.mgmt.lab.intra:5000/v2.0
identity_uri = http://vip.mgmt.lab.intra:35357
admin_tenant_name = service
admin_user = ceilometer
admin_password = **********

[notification]

disable_non_metric_meters = true

workload_partitioning = true

[oslo_messaging_rabbit]

rabbit_hosts = controller1.mgmt.lab.intra:5672,controller3.mgmt.lab.intra:5672,controller2.mgmt.lab.intra:5672
rabbit_userid = openstack
rabbit_password = **************
kombu_reconnect_delay=5.0

[publisher]

telemetry_secret = **********


[service_credentials]

os_username = ceilometer
os_password = ********
os_tenant_name = service
os_auth_url = http://vip.mgmt.lab.intra:5000/v2.0
os_region_name = labor
os_endpoint_type = internalURL

Update:

I see the same error in ceilometer-alarm-evaluator.log:

   2016-01-11 13:40:28.401 30850 ERROR ceilometer.alarm.service [-] alarm evaluation cycle failed
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service Traceback (most recent call last):
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometer/alarm/service.py", line 93, in _evaluate_assigned_alarms
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     alarms = self._assigned_alarms()
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometer/alarm/service.py", line 151, in _assigned_alarms
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     'value': True}])
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/alarms.py", line 77, in list
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     return self._list(options.build_url(self._path(), q))
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometerclient/common/base.py", line 85, in _list
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     return [obj_class(self, res, loaded=True) for res in data if res]
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 458, in __init__
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     self._add_details(info)
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/ceilometerclient/openstack/common/apiclient/base.py", line 479, in _add_details
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     for (k, v) in six.iteritems(info):
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service   File "/usr/lib/python2.7/dist-packages/six.py", line 576, in iteritems
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service     return iter(d.iteritems(**kw))
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service AttributeError: 'unicode' object has no attribute 'iteritems'
    2016-01-11 13:40:28.401 30850 TRACE ceilometer.alarm.service