Librarian: psycopg2.OperationalError: could not send data to server: Connection timed out

Bug #1035112 reported by David Ames
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Sidnei da Silva

Bug Description

 smagoun1 began getting intermittent 'Processing failed' errors trying to load private attachments from the librarian e.g.

Found these erros in the librarian logs:

2012-08-09 21:05:40+0000 [-] Unhandled error in Deferred:
2012-08-09 21:05:40+0000 [-] Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python2.6/", line 504, in __bootstrap
          File "/usr/lib/python2.6/", line 532, in __bootstrap_inner
          File "/usr/lib/python2.6/", line 484, in run
            self.__target(*self.__args, **self.__kwargs)
        --- <exception caught here> ---
          File "/srv/", line 207, in _worker
            result =, function, *args, **kwargs)
          File "/srv/", line 118, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/srv/", line 81, in callWithContext
            return func(*args,**kw)
          File "/srv/", line 37, in retry_transaction_decorator
            return func(*args, **kwargs)
          File "/srv/", line 555, in reset_store_decorator
            return func(*args, **kwargs)
          File "/srv/", line 73, in write_transaction_decorator
            ret = func(*args, **kwargs)
          File "/srv/", line 129, in _getFileAlias
            alias =, token, path)
          File "/srv/", line 82, in getFileAlias
            return self.library.getAlias(aliasid, token, path)
          File "/srv/", line 60, in getAlias
          File "/srv/", line 1077, in is_empty
            result = self._store._connection.execute(select)
          File "/srv/", line 266, in execute
            return Connection.execute(self, statement, params, noresult)
          File "/srv/", line 238, in execute
            raw_cursor = self.raw_execute(statement, params)
          File "/srv/", line 276, in raw_execute
            return Connection.raw_execute(self, statement, params)
          File "/srv/", line 322, in raw_execute
            self._check_disconnect(raw_cursor.execute, *args)
          File "/srv/", line 371, in _check_disconnect
            return function(*args, **kwargs)
        psycopg2.OperationalError: could not send data to server: Connection timed out

lifeless was able to reproduce and began stress testing

We ruled out pgbouncer and postgres

After restarting the librarians the error did not return even under stress test.

Related branches

David Ames (thedac)
tags: added: canonical-losa-lp
Revision history for this message
Robert Collins (lifeless) wrote :

I suspect that we suffer a network 'glitch' for some other unidentified reason. Then the connection is bad, and we're not actively closing it, rather trying to reset it, or some such thing.

Changed in launchpad:
status: New → Triaged
importance: Undecided → Critical
tags: added: oops
Revision history for this message
Robert Collins (lifeless) wrote :

(note this doesn't strictly speaking oops, but its the codepath that normally generates oopses, so same triage rule IMNSHO).

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Fixed in storm by treating this kind of error as DisconnectionError, you might want to pull that patch.

Changed in storm:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → Sidnei da Silva (sidnei)
Colin Watson (cjwatson)
Changed in storm:
status: Fix Committed → Fix Released
milestone: none → 0.21
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.