[ZODB-Dev] Re: corrupt filestorages - eep :-(

Enrique Perez eperez at yaco.es
Tue Feb 12 08:09:15 EST 2008


Chris Withers escribió:

>     data = oid_klass_loaders[reference_type](*args)
> KeyError: 'n'
> 
> I'm guessing this isn't good ;-) What does that KeyError mean?
> 
> What would be the suggested way of proceeding?

That happened to me once. It was a plone site, with two ZODB's, one 
mounted on top of another. I had an archetype content type that had a 
FileField, but I had forgotten to set 'NonEmptyFile' as validator for 
the field, and some default object (I think it was an empty list []) was 
being set for all content objects with no file attached. The same empty 
list for all content objects. I moved some of those objects from one 
ZODB to the other, and then, when trying to pack, I would have that 
error. The reference type 'n' is  (from ZODB/serialize.py):

     'n'
         Multi-database simple object reference.  The arguments consist
         of a databaase name, and an object id.

the empty list was referenced from multiple databases.

there is some discussion about this issue here:

http://www.nabble.com/Missing-loader-for-multidatabase-refs--tt9744503.html#a9744503

What I did was to walk through all objects in the database removing the 
empty files, and then packing was possible.

Hope that helps.


-- 
Enrique Pérez Arnaud
Yaco Sistemas S.L.



More information about the ZODB-Dev mailing list