Opened 6 years ago

Last modified 6 years ago

#3792 defect new

web.client.getPage sometimes throws errors that don't get handed to to right Errback

Reported by: usar Owned by:
Priority: normal Milestone:
Component: web Keywords: httpclient
Cc: Branch:
Author: Launchpad Bug:

Description (last modified by therve)

Every few thousand requests, probably due to broken servers or broken responses from fine servers, I get one of the following Tracebacks printed on the terminal even though I've registered an Errback with the Deferred returned by web.client.getPage

--- 1st ---
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 51, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 36, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.5/site-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
    why = getattr(selectable, method)()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 362, in doRead
    return self.protocol.dataReceived(data)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 231, in dataReceived
    why = self.lineReceived(line)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 405, in lineReceived
    status = l[1]
exceptions.IndexError: list index out of range
--- /1st ---
--- 2nd ---
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 51, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 36, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.5/site-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
    why = getattr(selectable, method)()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 362, in doRead
    return self.protocol.dataReceived(data)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 239, in dataReceived
    return self.rawDataReceived(data)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 450, in rawDataReceived
    self.setLineMode(rest)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 254, in setLineMode
    return self.dataReceived(extra)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 231, in dataReceived
    why = self.lineReceived(line)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 414, in lineReceived
    key, val = line.split(':', 1)
exceptions.ValueError: need more than 1 value to unpack
--- /2nd ---
--- 3rd ---
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 51, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 36, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.5/site-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
    why = getattr(selectable, method)()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 362, in doRead
    return self.protocol.dataReceived(data)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/basic.py", line 231, in dataReceived
    why = self.lineReceived(line)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 421, in lineReceived
    self.handleEndHeaders()
  File "/usr/lib/python2.5/site-packages/twisted/web/client.py", line 65, in handleEndHeaders
    self.factory.gotHeaders(self.headers)
  File "/usr/lib/python2.5/site-packages/twisted/web/client.py", line 261, in gotHeaders
    k, v = cook.split('=', 1)
exceptions.ValueError: need more than 1 value to unpack
--- /3rd ---

The third seems to happen with HTTP Cookie headers not containing proper key=value pairs, not sure with the other ones.

I'm running twisted 8.1.0 (Debian 8.1.0-4 from squeeze) on linux-ppc with Python 2.5.4.

Change History (3)

comment:1 Changed 6 years ago by therve

  • Description modified (diff)

comment:2 Changed 6 years ago by exarkun

  • Keywords httpclient added

comment:3 Changed 4 years ago by <automation>

  • Owner jknight deleted
Note: See TracTickets for help on using tickets.