[Twisted-web] Strange Nevow / Athena error

Paul Reznicek maillists at ivsn.com
Tue Jul 7 17:44:53 EDT 2009

Jean-Paul Calderone wrote:
> On Tue, 07 Jul 2009 20:58:13 +0200, Paul Reznicek <maillists at ivsn.com> wrote:
>> Hello,
>> I observe this error few times a day and have no idea about what is causing
>> it, neither under which conditions it happen (Nevow-0.9.33):
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 195, in addCallback
>>     callbackKeywords=kw)
>>   File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 186, in
>> addCallbacks
>>     self._runCallbacks()
>>   File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 328, in
>> _runCallbacks
>>     self.result = callback(self.result, *args, **kw)
>>   File "/usr/local/lib/python2.6/dist-packages/nevow/appserver.py", line 163, in
>> gotPageContext
>>     pageContext.tag.renderHTTP, pageContext
>> --- <exception caught here> ---
>>   File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 106, in
>> maybeDeferred
>>     result = f(*args, **kw)
>>   File "/usr/local/lib/python2.6/dist-packages/nevow/athena.py", line 440, in renderHTTP
>>     messageData = json.parse(requestContent)
>>   File "/usr/local/lib/python2.6/dist-packages/nevow/json.py", line 228, in parse
>>     value, tokens = parseValue(tokens)
>>   File "/usr/local/lib/python2.6/dist-packages/nevow/json.py", line 130, in parseValue
>>     if tokens[0] == '{':
>> exceptions.IndexError: list index out of range
>> I asked some user, but nobody observed problems on the user site,
>> any idea, what is wrong?
> This happens whenever the server receives an Athena message which is not
> valid json.  A common reason for this to happen is a proxy sitting between
> the server and client which decides to send a truncated request.  The client
> can recover from this in most cases, so it should be transparent to the user,
> but it gets logged on the server since it's not explicitly handled there.
> Just yesterday someone suggested that the server could report this failure
> mode a little more clearly.  That'd be fine with me.
> Jean-Paul
Yes, the server is behind an Apache proxy, sorry, I forgot to mention.
Thank you for explanation, one detail more - as long as I've used HTTPS
to connect to the proxy, I did NOT observed these errors although the
internal transfer between Apache and server on 8080 is plain http.

More information about the Twisted-web mailing list