On Wed, Jul 21, 2010 at 10:52 AM, Pedro Ferreira
> We are receiving occasional error messages such as:
> Traceback (most recent call last):
> line 459, in process
> line 224, in _setSessionUser
> self._aw.setUser( self._getSession().getUser() )
> line 815, in setstate
> line 856, in _setstate
> p, serial = self._storage.load(obj._p_oid, self._version)
> line 712, in load
> return self.loadEx(oid, version)[:2]
> line 735, in loadEx
> data, tid, ver = self._server.loadEx(oid, version)
> line 196, in loadEx
> return self.rpc.call("loadEx", oid, version)
> line 699, in call
> raise inst # error raised by server
> POSKeyError: 0x336b08e2
> I read somewhere that this could mean our FileStorage is corrupted,
No, where 'corrupted' means that the structure of the file storage is broken.
> I find it strange that it only happens occasionally.
> Any clue on what can be causing this?
You have a dangling reference. A database record has a reference to a
persistent object, via its object ID, and the referenced object has
This can happen if you are using multiple databases, with cross
database references, and you garbage collect (typically through pack)
the databases individually.
It can happen if you do certain pathological things in your app. For example:
x = some_collection.pop(key)
some_collection[key] = x
At this point, x has been deleted through packing, but some_collection
references it. This is mostly theoretical. I don't think I've heard
of this happening in the wild. In theory, ZODB could check for bugs
like this, but it doesn't at this time.
POSKeyErrors have, in the past, resulted from bugs, especially pack
bugs, although I'm mot aware of any recent bugs that would cause
POSKeyErrors. (Some would argue that cross-database references are a
bug, although I would call them an advanced feature that must be used
with care. :)
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org