[Zope-dev] Re: InvalidObjectReference: Attempt to store an object from a foreign database connection

Tres Seaver tseaver at zope.com
Mon Mar 29 15:20:01 EST 2004


Christian Heimes wrote:
> There is a problem regarding plone, cmf and the quickinstaller tool. I'm 
> getting an InvalidObjectReference error after reinstalling a product 
> with the quickinstaller a second time or several times. It looks like 
> the error happens only after I visited the plone ui at least once but 
> that could be concurrence. Only restarting zope stops the error until 
> the next occurance.
> 
> Version: Python 2.3.3 (Debian testing)
>          Zope 2.7 (CVS branch)
>          CMF 1.4 (CVS)
>          Plone 2.0
> 
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 104, in publish
>   Module Zope.App.startup, line 224, in commit
>   Module ZODB.Transaction, line 233, in commit
>   Module ZODB.Transaction, line 348, in _commit_objects
>   Module ZODB.Connection, line 419, in commit
>    - __traceback_info__: (('Products.CMFCore.ActionInformation', 
> 'ActionInformation'), '\x00\x00\x00\x00\x00\x00\x9e\xe3', '')
> InvalidObjectReference: Attempt to store an object from a foreign 
> database connection
> 
> I tried to get the object by starting zope with zopectl debug and using 
> app._p_jar['\x00\x00\x00\x00\x00\x00\x9e\xe3'] but the object wasn't 
> available so it seems to be a new object that is saved the first time.
> 
> After changing the pickler from cPickle to pickle:
> 
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 104, in publish
>   Module Zope.App.startup, line 224, in commit
>   Module ZODB.Transaction, line 233, in commit
>   Module ZODB.Transaction, line 348, in _commit_objects
>   Module ZODB.Connection, line 419, in commit
>    - __traceback_info__: (('Products.CMFCore.ActionInformation', 
> 'ActionInformation'), '\x00\x00\x00\x00\x00\x00\xa2G', '')
>   Module pickle, line 231, in dump
>   Module pickle, line 293, in save
>   Module pickle, line 663, in save_dict
>   Module pickle, line 695, in _batch_setitems
>   Module pickle, line 278, in save
> InvalidObjectReference: Attempt to store an object from a foreign 
> database connection
> 
> pickle.save():278 is calling self.persistent_id(obj) which is patched to 
> call coptimizations.new_persistent 
> (pickler.persistent_id=new_persistent_id(self, stack)) in 
> ZODB.Connection.commit(). The exception itself is raised by 
> persistent_id_call() because of (jar != Py_None && jar != self->jar) is 
> true.
> 
> Debugging so deep into the zodb is a bit over my knowledge so I would be 
> glad if someone could dig in, too. :)

Your report sounds like a long-known problem with the original Plone 
installer, which was caching a persisted object at module scope in one 
request, and then trying to reuse it later.  Andy McKay and I figured 
that one out back in August 2002, I think.  I am CC'ing Andy directly so 
that he knows I know he knows. :)

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-Dev mailing list