[Twisted-web] Strange Nevow / Athena error

Jean-Paul Calderone exarkun at divmod.com
Tue Jul 7 15:12:01 EDT 2009


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



More information about the Twisted-web mailing list