Is Pecan returning non-string response header data?

53 views
Skip to first unread message

Eric Pendergrass

unread,
Apr 10, 2014, 3:46:35 PM4/10/14
to peca...@googlegroups.com
Hi, I'm using Pecan in the OpenStack Ceilometer project for public cloud development.  I have Ceilometer reporting, which is configured as a WSGI application, running in Apache mod_wsgi.  The entire Ceilometer reporting application is a single WSGI element.

I have it behind Apache to add SSL support as I understand Pecan does not do SSL.  Everything works great except when exceptions are thrown by the application running in Pecan.  Regardless of the status code of the response from Pecan, Apache turns it into a 500 error.

In investigating this I found this error in Apache's error log:
[Thu Apr 10 19:40:02 2014] [error] [client 127.0.0.1] mod_wsgi (pid=16162): Exception occurred processing WSGI script '/usr/share/pyshared/ceilometer/api/app.wsgi'.
[Thu Apr 10 19:40:02 2014] [error] [client 127.0.0.1] TypeError: expected byte string object for header value, value of type int found

From this Stackforge post I submitted I understand it means Apache is receiving a response header with an int type value (see the post response and comments).

I'm trying to find where the response headers are created to diagnose this problem.  Can anyone tell me which module in Pecan would create these headers, or where I should start debugging?

Many thanks,
Eric

Doug Hellmann

unread,
Apr 11, 2014, 12:29:47 PM4/11/14
to peca...@googlegroups.com
Hi, Eric,

It sounds like the app or a piece of middleware is adding a non-string
header, but it's hard to say for sure. Are you using stock ceilometer,
or do you have anything extra added? Which version?

Most of the Pecan devs are at PyCon this weekend, so it may be a few
days before they can respond with more detailed debugging suggestions.

Doug
> --
> You received this message because you are subscribed to the Google Groups
> "Pecan Developers List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pecan-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Eric Pendergrass

unread,
Apr 11, 2014, 12:45:57 PM4/11/14
to peca...@googlegroups.com
Thanks for the reply, Doug.  It's stock ceilometer, version close to 2014.1.a83.ga49d0d4.  There's nothing between Apache and Pecan TMK other than mod_wsgi.

Eric


You received this message because you are subscribed to a topic in the Google Groups "Pecan Developers List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pecan-dev/Y275PSiMR3I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pecan-dev+...@googlegroups.com.

Jonathan LaCour

unread,
Apr 11, 2014, 5:10:57 PM4/11/14
to peca...@googlegroups.com, Eric Pendergrass
> Thanks for the reply, Doug. It's stock ceilometer, version close to
> 2014.1.a83.ga49d0d4. There's nothing between Apache and Pecan TMK
> other than mod_wsgi.

Sounds to me like you’ve got a header being created with an integer
value, rather than a string. I suspect it might be WSME. Pretty sure
it isn’t Pecan, but no way to know based upon the information you’ve
given so far.

My advice would be to find a request you can send to ceilometer that
reproduces the error reliably, and then drop a pdb breakpoint in and
inspect the `request.headers` object to find which header is causing
the problem, and then move on from there.

- Jonathan


ryan.p...@dreamhost.com

unread,
Apr 12, 2014, 11:07:31 AM4/12/14
to peca...@googlegroups.com
Eric,

I dug around a bit, and was able to reproduce what you saw.  I believe this is actually a bug in Ceilometer.  I've opened a bug, and a suggested patch:

Eric Pendergrass

unread,
Apr 12, 2014, 1:50:07 PM4/12/14
to pecan-dev
Cool, thanks Ryan!

Eric


--
Reply all
Reply to author
Forward
0 new messages