[ZODB-Dev] Fixing POSKeyErrors :-)

Marius Gedminas mgedmin at b4net.lt
Wed Feb 13 11:49:16 EST 2008


On Tue, Feb 12, 2008 at 08:32:52PM +0000, Chris Withers wrote:
> Okay, so I found a fix for my problem, thought I'd share for others.

I think I also stumbled upon this (or a very close) problem with Zope
2.9.something:

  1. import a folder into /temp_folder
  2. cut & paste that folder into /
  3. come back next day and notice that your Zope is totally broken
     (POSKeyErrors everywhere pointing into a nonexistent OID from a
     TemporaryStorage)

I didn't do a manual pack, though, but I assume TemporaryStorage does
some sort of periodic garbage collection on its own.

> ...do a bin/zopectl debug and then do roughly the following:

In my case I wasn't able to do bin/zopectl debug.  I got the same
POSKeyError from zopectl debug and when I finally got the Python shell,
it didn't have an open database.

I was lucky that there was no content loss: I just created a new empty
DB and imported the new version of the site directly into /.

> It's a shame ZODB doesn't turn POSKeyErrors into proper Broken objects as 
> it does when the class can no longer be imported. The problem with 
> POSKeyErrors is that they prevent you accessing *any object that refers to 
> the broken object* not just the missing object itself. This means that when 
> objects *do* go missing, the data loss can be much much worse than it needs 
> to be.
>
> What does everyone else think?

Data-loss bugs are *bad* and drive users away from Zope.

Marius Gedminas
-- 
2B OR NOT 2B == FF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20080213/2dd6fe43/attachment.bin


More information about the ZODB-Dev mailing list