TypeError: Cache values must be persistent objects.
Help! I'm trying to develop a filesystem-based Product (here 'ABCD') and unless I remove the "ABCD" folder from my Products directory, I get the following error IN THE MANAGEMENT INTERFACE. Is it possible to determine what's causing the problem? After multiple restarts, I did a global "Find" in the ZMI and (I think) deleted all objects of type "ABCD Content". But still the problem persists (no pun intended). Gaah! How can I fix this? ===== event.log contains ========== 2005-06-21T14:57:17 ERROR(200) ZODB Couldn't load state for 0x28b5 Traceback (most recent call last): File "/usr/local/zope/lib/python/ZODB/Connection.py", line 600, in setstate self._set_ghost_state(obj, p) File "/usr/local/zope/lib/python/ZODB/Connection.py", line 639, in _set_ghost_state state = unpickler.load() File "/usr/local/zope/lib/python/ZODB/Connection.py", line 227, in _persistent_load self._cache[oid] = object TypeError: Cache values must be persistent objects. ========== FROM THE ============================= Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module App.special_dtml, line 175, in _exec Module DocumentTemplate.DT_Let, line 76, in render Module DocumentTemplate.DT_In, line 643, in renderwob Module DocumentTemplate.DT_In, line 771, in sort_sequence Module ZODB.Connection, line 600, in setstate Module ZODB.Connection, line 639, in _set_ghost_state Module ZODB.Connection, line 227, in _persistent_load - __traceback_info__: ('\x00\x00\x00\x00\x00\x009^', ('Products.ABCD.XML_File', 'XML_File')) TypeError: Cache values must be persistent objects. ============================= Plone version: 2.0.5 Zope version: (Zope 2.7.6-final, python 2.3.4, linux2) Apache version: CMF version (if known): CMF-1.4.7 Browser(s) and version(s): Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Operating system: linux2 Python version: 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] Debug mode: Yes ============================= ABCD 0.4 ATExtensions 0.6 installed Archetypes 1.3.3-final installed BTreeFolder2 BTreeFolder2-1.0.1 CMFActionIcons 0.9 installed CMFCalendar CMF-1.4.7 installed CMFCore CMF-1.4.7 CMFDefault CMF-1.4.7 CMFFormController 1.0.4 installed CMFMember 1.0.1 installed CMFPlone 2.0.5 CMFQuickInstallerTool 1.5.1 CMFTopic CMF-1.4.7 CMFTutorial 0.1.2 CompositePage CompositePage-0.2 DCWorkflow CMF-1.4.7 Epoz 0.8.5 installed ExternalEditor 0.8 ExternalMethod External Method-1-0-0 FlexibleTopic 1.1 installed Formulator Formulator 1.6.2 GroupUserFolder 2.0.1 installed Lesson 0.1 LocalFS LocalFS-1-7-andreas MIMETools MailHost MailHost-1-3-0 MimetypesRegistry 1.3.3-final05 installed Minimal 0.1 MySite 0.4 installed OFSP OFSP-1-0-0 OpenFlow 1.1.0 PageTemplates PageTemplates-1-4-0 PlacelessTranslationService 1.0 PloneCollectorNG 1.2.6 installed PloneErrorReporting 0.11 installed PluginIndexes PortalTransforms 1.3.4-final installed PythonScripts PythonScripts-2-0-0 Sessions SiteAccess SiteAccess-2-0-0 SiteErrorLog StandardCacheManagers StandardCacheManagers-1-1-0 TemporaryFolder Transience ZCTextIndex ZCatalog ZCatalog-2-2-0 ZGadflyDA ZODBMountPoint ZReST 1.1 ZSQLMethods ZopeTutorial Zope Tutorial 1.2 generator 1.3.0-final17 mxmCounter 1.1.0 validation 1.3.2-final
Nikko Wolf wrote:
Help!
I'm trying to develop a filesystem-based Product (here 'ABCD') and unless I remove the "ABCD" folder from my Products directory, I get the following error IN THE MANAGEMENT INTERFACE.
Is it possible to determine what's causing the problem? After multiple restarts, I did a global "Find" in the ZMI and (I think) deleted all objects of type "ABCD Content". But still the problem persists (no pun intended).
Gaah! How can I fix this?
Well, with the "ABCD" product folder moved, I restarted Zope. Then, in the ZMI I manually looked at every folder in which I thought there was the slightest chance that I might have added an XML_File object. After a while, I found one in a folder beneath the Plone instance. I delete that, restarting Zope with ABCD back where it belonged, this seems to have fixed the problem this time. But that begs the questions + why didn't the stack backtrace give the problem ID? + if "0x28b5" can be deciphered as an ID, how? + why didn't the Find locate the broken instance? (it *might* be since I've created about 15 different portal_types, and the "ABCD Content" wasn't really what the offending ID was). + is this a common problem with file-system (or ZClass) products? Phew, Nikko
Nikko Wolf wrote at 2005-6-21 16:13 -0600:
... But that begs the questions + why didn't the stack backtrace give the problem ID?
It would not have helped: the problem was not an individual instance but a class problem... Your problem is of a rather rare type (few people remove "Persistence" from the inheritance chain for persistent objects). In general (not in your special case), the id cannot be determined in case of loading problems. More importantly: The error was detected in ZODB, a component used by Zope but also externally. And ZODB cannot expect all its persistent objects to have an id (indeed most, even in Zope, do not!).
+ if "0x28b5" can be deciphered as an ID, how?
Neither this nor your original message tells us what the "0x28b5" should be ;-) It probably is the object's "oid" (object id), in hexadecimal form. It is useful, to load the object from ZODB in an interactive Python interpreter to analyse the problem more easily (i.e. use "pdb.pm" to analyse all objects relevant for the exception).
+ why didn't the Find locate the broken instance? (it *might* be since I've created about 15 different portal_types, and the "ABCD Content" wasn't really what the offending ID was).
Because, it would have died (same exception as reported in your original message) when it had tried to access the object. Do not expect to get realiable results when you did something that prevents objects to be loaded from ZODB ;-)
+ is this a common problem with file-system (or ZClass) products?
Few people remove "Persistence" from the inheritance chain of a class once they have stored persistent objects of this class in the ZODB... -- Dieter
Nikko Wolf wrote at 2005-6-21 15:08 -0600:
I'm trying to develop a filesystem-based Product (here 'ABCD') and unless I remove the "ABCD" folder from my Products directory, I get the following error IN THE MANAGEMENT INTERFACE.
Is it possible to determine what's causing the problem? After multiple restarts, I did a global "Find" in the ZMI and (I think) deleted all objects of type "ABCD Content". But still the problem persists (no pun intended). ... self._cache[oid] = object TypeError: Cache values must be persistent objects.
Looks as if you had changed the class structure: An object that formerly was persistent (when it was stored in the ZODB) now gets a class which is no longer derived from "Persistence". Note that the ZODB identifies the class of an object by "modulepath, classname". You should ensure that the class identified in this way always derives from "Persistence" (and that is exists). To find out what object this is, you catch the error and look at "object.__class__".
... Module ZODB.Connection, line 227, in _persistent_load - __traceback_info__: ('\x00\x00\x00\x00\x00\x009^', ('Products.ABCD.XML_File', 'XML_File')) TypeError: Cache values must be persistent objects.
As we see, catching is not necessary. The traceback is enough ;-) "Products.ABCD.XML_File" lost its "Persistence" inheritance... -- Dieter
participants (2)
-
Dieter Maurer -
Nikko Wolf