[ZODB-Dev] cPickle: state is not a directory/Upgrade to Zope 2.7failing

Tim Peters tim at zope.com
Mon Nov 3 11:36:18 EST 2003


[Andreas Jung]
> I am trying to move a Zope 2.6.2 site (Python 2.2.3, CMF 1.4) to Zope
> 2.7 with Python 2.3.2.
>
> When I start up the site, it fails badly :-( :
>
> ----
> 2003-11-03T14:52:44 INFO(0) ZODB Mounted database
> '145966912_1035475459.685228' at /temp_folder
> ------
> 2003-11-03T14:52:44 ERROR(200) ZODB Couldn't load state for
> 0000000000014652 Traceback (most recent call last):
>   File "/develop/sandboxes/tracker/Zope/lib/python/ZODB/Connection.py",
line 564, in setstate
>       self._set_ghost_state(obj, p)
>   File "/develop/sandboxes/tracker/Zope/lib/python/ZODB/Connection.py",
line 603, in _set_ghost_state state = unpickler.load()
>       UnpicklingError: state is not a dictionary
> ...

There's not much I can deduce from that, other than that cPickle is trying
to create an instance of some class, where the class doesn't define
__setstate__ itself, but pickling provided *some* state object for use by
the default __setstate__, but provided a bogus state object.

So we need more info.  Two things:

1. Fiddle _set_ghost_state to output repr(p) when this fails.
   That is, I need to see the actual pickle, in all its gory glory.
   All we can deduce from the above is that the state object is
   neither None nor a dict (the error message told us it's not a
   dict, and it wouldn't have gotten to that check if it were None).

2. You might try fiddling _set_ghost_state to use pickle.py instead
   of the cPickle module.  Sometimes there's a bug in one that's not
   in the other, and even if not pickle.py sometimes produces
   error messages that are more informative.




More information about the ZODB-Dev mailing list