sample-create fails with "TypeError: string indices must be integers, not str"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-ceilometerclient |
Fix Released
|
Undecided
|
Chris Dent |
Bug Description
When using the client, from the command line and as a library, sample-create (or samples.create) fails with "TypeError: string indices must be integers, not str" when calling the equivalent of:
ceilometer sample-create -r 'house' -m cpu_util --meter-type gauge --meter-unit '%' --sample-volume 8
In ceilometer-api the results in the traceback pasted below.
It appears that wsme is expecting the data in the body of the post to be a list of dicts whereas what is sent is just a dict. It's not clear if the problem is in bad packaging in the client or bad expectations on the server.
Note that this was found while exploring ceilometer bugs in rally: https:/
2014-09-10 19:04:21.668 1646 ERROR wsme.api [-] Server-side error: "string indices must be integers, not str". Detail:
Traceback (most recent call last):
File "/usr/lib/
pecan.
File "/usr/lib/
from_body = args_from_
File "/usr/lib/
body, datatypes, bodyarg=
File "/usr/lib/
kw = {argname: fromjson(
File "/usr/lib/
return f(*args, **kw)
File "/usr/lib/
return [fromjson(
File "/usr/lib/
return f(*args, **kw)
File "/usr/lib/
val_fromjson = fromjson(
TypeError: string indices must be integers, not str
192.168.1.11 - - [10/Sep/2014 19:04:21] "POST /v2/meters/cpu_util HTTP/1.1" 500 120
Changed in python-ceilometerclient: | |
assignee: | nobody → Chris Dent (chdent) |
Changed in python-ceilometerclient: | |
milestone: | none → 1.3.0 |
status: | Fix Committed → Fix Released |
From IRC (below) we learn that it used to work so something must have changed in the client or server in the interim:
8:09pm] boris-42: cdent so you have issues with these 2 benchmarks?
[8:09pm] boris-42: cdent actually when we added them they worked
[8:10pm] cdent: can you pinpoint a time when they broke?
[8:10pm] boris-42: cdent nope
[8:10pm] boris-42: cdent I can point just when we added them
[8:10pm] cdent: as that will probably help us fix the problem in the client or server
[8:10pm] boris-42: cdent heh
[8:10pm] cdent: presumably some window of time though: they worked at time X, and then somebody reported they were broken at time Y
[8:11pm] boris-42: cdent I'll try to do my best
[8:11pm] cdent: thanks
[8:12pm] boris-42: cdent so we saw that they don't work ~ 1 Aug
[8:12pm] boris-42: cdent maybe few days before
[8:13pm] cdent: and they were created and working around when?
[8:13pm] boris-42: cdent looking...
[8:15pm] boris-42: cdent so lemme check
[8:15pm] boris-42: cdent end of May
[8:15pm] cdent: excellent, thank you, I suspect that will be quite helpful