Ceilometer middleware for swift proxy has "coercing to Unicode: need string or buffer" fail

Asked by Che-Wei Hu on 2013-08-30

Hi, all

I am a beginner to study openstack. Please help me to check the following error messages.

I add filter section for ceilometer to /etc/swift/proxy-server.conf to measure incoming and outgoing traffic of swift.

But I got following error messages:

proxy-server Removing dead child XXXX
proxy-server Started child XXXX
CRITICAL ceilometer [-] coercing to Unicode: need string or buffer, NoneType found
...
proxy-server Removing dead child XXXX
proxy-server Started child XXXX
CRITICAL ceilometer [-] coercing to Unicode: need string or buffer, NoneType found
...

The followings are what I add in the proxy-server.conf:

[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth ceilometer proxy-server
...
[filter:ceilometer]
use = egg:ceilometer#swift

Swift works fine before I add the ceilometer middleware for swift proxy.

Could some one help to provide suggestions for this issue? Thanks a lot.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ceilometer Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Krüger
Solved:
2013-08-30
Last query:
2013-08-30
Last reply:
2013-08-30
Best Thomas Krüger (thkrueger) said : #1

This is a Python error, which happens when you try to put a unicode string together with a variable that is not a string like object by usung the + operator. In your case the variable is None. Here are examples which raise this error:

>>> u'There are ' + 3 + u' dogs.'
TypeError: coercing to Unicode: need string or buffer, int found
>>> u'There are ' + None + u' dogs.'
TypeError: coercing to Unicode: need string or buffer, NoneType found

This should be a bug. You should report it to the developers.

Che-Wei Hu (tethu0822) said : #2

Hi, Thomas:

Thanks for your rapid and clear reply. :)

Che-Wei Hu (tethu0822) said : #3

Thanks Thomas Krüger, that solved my question.