Pre-Python 3 ZODB Verification Woes: grokcore.component.interfaces, Archetypes.BaseUnit, …

:wave: Hi folks!

:scroll: I've following along the Plone 5.2 → Python 3 and ZODB → Python 3 guides—and also making sure eea.aliases in there, packing to zero days, etc.—and have gotten to the zodbverify point where, out of 583560 records, there are:

  • 19197 ImportError: No module named grokcore.component.interfaces
  • 1360 ImportError: No module named Archetypes.BaseUnit
  • 352 ImportError: No module named ATContentTypes.content.document
  • 242 ImportError: No module named blob.field
  • 242 ImportError: No module named blob.content
  • 91 ImportError: No module named Archetypes.ReferenceEngine
  • 62 ImportError: No module named ATContentTypes.content.folder
  • 16 ImportError: No module named ATContentTypes.content.link

:disappointed: And now I'm at a loss. The Archetypes → Dexterity migration seemed to go off without a hitch but given the above I'm not so sure. And we worked hard to scrub Grok from the code base but 19k instances in the database tells us we omitted a step (or it wasn't documented).

:raised_hand: So, any ideas? Ignore these and brazenly/bravely/foolishly press on with zodbupdate anyway?

:pray: Thank you!

@nutjob: Most of these are most likely entries in the Relation-Cataloig and IntId-Catalog and can be solved with this:

from collective.relationhelpers.api import rebuild_relations
rebuild_relations(flush_and_rebuild_intids=True)

And yes, you can go ahead and run zodbupdate and fix these issues afterwards. Also do not forget packing before running zodbverify again!

Read this for more details:

3 Likes

Excelsior! :tada:

Thanks @pbauer. This helps enormously. The mere rebuild_relations took the grokcore count from 19k → zero. That's fantastic. I feel a lot more capable now in facing the remaining errant pickles.

The ZODB remains one of the "voodoo magic" parts of Zope that I try not to think about, but your linked article is fantastic. :clap:

3 Likes