Can not add content due to recursion error (Mosaic) [RESOLVED]

Anybody familiar with the error below? This is on a Plone 5.1.4 site. The error may be related to using collections as a source of tiles in collective.cover. There was a collection item and a cover item which used it that shows a recursion error on the view. I deleted them from the debug console. Other content seems fine but I can no longer add content on this dev site. This is the error on save of any add form:

--
  Module zope.component._api, line 139, in subscribers
  Module zope.interface.registry, line 442, in subscribers
  Module zope.interface.adapter, line 607, in subscribers
  Module five.intid.intid, line 103, in addIntIdSubscriber
  Module five.intid.intid, line 45, in register
  Module ZODB.Connection, line 800, in setstate
  Module ZODB.serialize, line 622, in setGhostState
  Module ZODB.serialize, line 615, in getState
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__
  Module plone.app.drafts.proxy, line 79, in __getattr__

There is also this related error in the logs:

2018-12-18T01:54:05 ERROR ZODB.Connection Couldn't load state for BTrees.OIBTree.OIBucket 0x023c69
Traceback (most recent call last):
  File "/var/plone/aa.site/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 800, in setstate
    self._reader.setGhostState(obj, p)
  File "/var/plone/aa.site/eggs/ZODB-5.3.0-py2.7.egg/ZODB/serialize.py", line 622, in setGhostState
    state = self.getState(pickle)
  File "/var/plone/aa.site/eggs/ZODB-5.3.0-py2.7.egg/ZODB/serialize.py", line 615, in getState
    return unpickler.load()
  File "/var/plone/aa.site/eggs/plone.app.drafts-1.1.2-py2.7.egg/plone/app/drafts/proxy.py", line 79, in __getattr__
    deleted = getattr(self.__draft, '_proxyDeleted', set())
  File "/var/plone/aa.site/eggs/plone.app.drafts-1.1.2-py2.7.egg/plone/app/drafts/proxy.py", line 79, in __getattr__
    deleted = getattr(self.__draft, '_proxyDeleted', set())
  File "/var/plone/aa.site/eggs/plone.app.drafts-1.1.2-py2.7.egg/plone/app/drafts/proxy.py", line 79, in __getattr__
    deleted = getattr(self.__draft, '_proxyDeleted', set())
  File "/var/plone/aa.site/eggs/plone.app.drafts-1.1.2-py2.7.egg/plone/app/drafts/proxy.py", line 79, in __getattr__
    deleted = getattr(self.__draft, '_proxyDeleted', set())
  File "/var/plone/aa.site/eggs/plone.app.drafts-1.1.2-py2.7.egg/plone/app/drafts/proxy.py", line 79, in __getattr__

I deleted all drafts in portal_drafts. Also uninstalled plone.app.drafts from the quickinstaller which removed portal_drafts but now I can not install it in the quickinstaller since it triggers the recursion error.

I would appreciate any leads. Is an item in the ZODB broken?

No ideas, but I would probably not have uninstalled plone.app.drafts...

Does running with PdbDebugMode help you by stopping execution when you get those exceptions? Otherwise Iā€™d be adding logging statements in plone.app.drafts.proxy around line 79

Was it necessary to remove the collection and cover items from a debug console? I guess you must have thought so but maybe deleting that way left things behind that the UI would not have

Thank you for your feedback, Kim.

I deactivated p.a.drafts when portal_drafts was empty (from the ZMI). I was thinking the storage it was using had some issues so perhaps I can add it again with the quickinstaller.

I deleted the items with recursion issues on its views (display /edit) thinking they were the broken items. These items would also cause a recursion error on reindexing. After I deleted the items, I performed a site-wide reindexing but the problem persisted.

I am not sure it matters but the folder content type was configured to have the draftable behavior. This was likely set in the control panel by a team member. I removed the draftable behavior from the collection's portal_type configuration. I also did a reindex so that behavior entries in the catalog will also be removed. The problem persisted.

Another info is that there was a re-implementation of the user's member folder and I deleted the existing member folders. There were no issues deleting these folders and their contents (mostly folder and collection items).

I have since reverted the ZODB to a back up.

I will debug this problem with PDB when I find the time. This is the first time I encountered such an error and I want to know why it happened.

Just posting back that a work around for resolving the issue is to remove plone.app.mosaic which required plone.app.drafts. I deactivated mosaic via the portal quickinstaller. It was also necessary to deactivate p.a.drafts and p.standardtiles. Then p.a.mosaic was removed from our egg requirement.

I hope you don't need Mosaic on that site! :slight_smile:

Fortunately, we didn't. We used c.cover but p.a.mosaic was installed when we were reviewing both. We were reluctant in removing p.a.mosaic because we initially thought p.a.drafts was also required by p.a.tiles.

1 Like