dburns
unread,Jun 25, 2009, 9:51:08 PM6/25/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
Hi,
My app normally works fine, but certain POST data is causing it to
blow up with a 500 (internal server error). The log contains the
message in the stack trace below. Trouble is, my app hasn't even got
started yet! It happens right at the run_wsgi_app line. My
webapp.RequestHandler has not received control yet, so what can I do?
The error mentions ascii, but I don't know why it assumes the POST
data was ascii. It's probably UTF-8. I say probably since the POST
data isn't directly in my control (it's from Facebook, since this is a
Facebook app).
Some thoughts:
1) Is there a bug in the run_wsgi_app code? Seems to me that data
arriving from outside shouldn't be able to cause an internal server
error.
2) Could the POST data be malformed? I don't know much about POST
data -- perhaps it's identified as ascii, in error? I'd like to trap
it and examine it but I don't know how to do that without the help of
webapp.RequestHandler (the app dies before this gets invoked).
My code is the standard mainline code
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
Here's the stack trace from my log. Thanks for any help!
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode
byte 0xc3 in position 10988: ordinal not in range(128)
Traceback (most recent call last):
File "/base/data/home/apps/(my directory)/index.py", line 216, in
<module>
main()
File "/base/data/home/apps/(my directory)/index.py", line 213, in
main
run_wsgi_app(application)
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
util.py", line 76, in run_wsgi_app
result = application(env, _start_response)
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 521, in __call__
response.wsgi_write(start_response)
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 241, in wsgi_write
body = self.out.getvalue()
File "/base/python_dist/lib/python2.5/StringIO.py", line 270, in
getvalue
self.buf += ''.join(self.buflist)