Zope InvalidObjectReference
I am getting a very strange error from one user with any webbrowser that they try to use. On adding/modifying one of my objects they get this error with this traceback. Traceback (innermost last): File /home/zope/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /home/zope/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/zope/Zope-2.3.3-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook File /home/zope/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, line 175, in publish File /home/zope/Zope-2.3.3-src/lib/python/Zope/__init__.py, line 235, in commit File /home/zope/Zope-2.3.3-src/lib/python/ZODB/Transaction.py, line 300, in commit File /home/zope/Zope-2.3.3-src/lib/python/ZODB/Connection.py, line 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000qM', '')) InvalidObjectReference: Attempt to store an object from a foreign database connection The object it is referring to is one of my objects however the problem is that no line of my code is referenced and I am not sure where to even begin looking. To add more confusion to the situation I have used the exact same versions of the webbrowsers that they are using with and without a squid proxy cache and I can't duplicate that behavior. Actually in about 30 people using the site no one can get that behavior. However, once he causes that error to occur all objects of that type act that way until I hit refresh on the products entry in the control panel page. The problem ends up being is that it goes away for everyone till he tries to use it again. I was wondering if anyong has some ideas, wild guesses etc on where to even look to try and figure out what is going wrong. I would like to give a much more detailed error description but so far I am at a loss since any changes I make to the code reload it and the problem goes away until he uses it again. Zope 2.3.3 python 1.5.2 on Debian linux with 2.4.4 kernel Browsers: Opera 5.0 for Linux - 20010510 Build 024 -[5] Mozilla/5.0 (X11; U; Linux 2.2.16-22 i586; en-US; 0.8.1) Gecko/20010421 He has also been using IE, mozilla, and opera 5 for windows though the exact version numbers I have not been able to find out. Thanks
kosh writes:
... 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000qM', '')) InvalidObjectReference: Attempt to store an object from a foreign database connection That sounds really strange:
Zope usually has a pool of connections to the ZODB. When an object is brought from the ZODB into Zope's cache, it remembers the connection it was loaded with. When a commit is executed, the modified objects in the associated cache are stored into the ZODB. Apparently, an object is found that does not belong to the current connection. I have no idea, how this can happen: The only possibility I see by now is a global container shared by all threads that contains persistent objects (this must never happen! It is fatal, as it produces errors as you describe it). Dieter
Hi Kosh, This can occur if you attach an attribute of an object to another existing object using assignment rather than setattr (and the connection is different, as may be the case) for example existingObject.attribute = otherObject.otherattribute (attribute can be a method, of course.) can cause the error you see - it happened to me! Use setattr(existingObject,attribute,otherObject.otherattribute) instead, it might help you... For further reference see line 640 of Blark.py in the CMFOptions sources. I would suspect that you have some python code doing something like.... When I uncovered this problem it appeared to have been working for a while - and often it would work until this type of bug happened. Good Luck! Jeff Sasmor jeff@sasmor.com www.netkook.com is an "open Zope CMF site" ----- Original Message ----- From: "kosh" <kosh@aesaeion.com> To: <zope@zope.org> Sent: Wednesday, July 11, 2001 5:33 PM Subject: [Zope] Zope InvalidObjectReference
375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000qM', '')) InvalidObjectReference: Attempt to store an object from a foreign database connection
The object it is referring to is one of my objects however the problem is that no line of my code is referenced and I am not sure where to even begin looking.
participants (3)
-
Dieter Maurer -
Jeff Sasmor -
kosh