Migration to Plone 5.2 - ZODB to py3 - zodbverify

Hi all,

I have read this: Upgrade Guide

I do this:
> py2/bin/zodbverify -f py2/var/lexikon/filestorage/Data.fs -D

i get this traceback:

INFO:zodbverify:Scanning ZODB...
WARNING:Init:Class Products.CMFFormController.ControllerPythonScript.ControllerPythonScript has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
WARNING:Init:Class Products.CMFFormController.ControllerValidator.ControllerValidator has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
INFO:zodbverify:
Could not process <type 'BTrees.OIBTree.OISet'> record '\x00\x00\x00\x00\x00\x12X\n':
INFO:zodbverify:BTrees.OIBTree.OISet
INFO:zodbverify:'\x80\x02cBTrees.OIBTree\nOISet\nq\x01.\x80\x02(czope.location.interfaces\nILocation\nq\x02cplone.app.lockingbehavior.behaviors\nILocking\nq\x03cOFS.interfaces\nIManageable\nq\x04cProducts.CMFCore.interfaces._content\nIMinimalDublinCore\nq\x05cProducts.CMFCore.interfaces._content\nIMutableDublinCore\nq\x06cProducts.CMFCore.interfaces._content\nIMutableMinimalDublinCore\nq\x07cplone.app.content.interfaces\nINameFromTitle\nq\x08cProducts.CMFCore.interfaces._content\nIOpaqueItemManager\nq\tcAccessControl.interfaces\nIOwned\nq\ncAccessControl.interfaces\nIPermissionMappingSupport\nq\x0bcpersistent.interfaces\nIPersistent\nq\x0ccApp.interfaces\nIPersistentExtra\nq\rcOFS.interfaces\nIPropertyManager\nq\x0ecplone.app.relationfield.behavior\nIRelatedItems\nq\x0fcplone.app.contenttypes.behaviors.richtext\nIRichText\nq\x10cAccessControl.interfaces\nIRoleManager\nq\x11cplone.contentrules.engine.interfaces\nIRuleAssignable\nq\x12cProducts.CMFDynamicViewFTI.interfaces\nISelectableBrowserDefault\nq\x13cOFS.interfaces\nISimpleItem\nq\x14cProducts.CMFPlone.interfaces.syndication\nISyndicatable\nq\x15cplone.app.contenttypes.behaviors.collection\nISyndicatableCollection\nq\x16cplone.locking.interfaces\nITTWLockable\nq\x17cOFS.interfaces\nITraversable\nq\x18cplone.uuid.interfaces\nIUUIDAware\nq\x19cApp.interfaces\nIUndoSupport\nq\x1acProducts.CMFCore.interfaces._content\nIWorkflowAware\nq\x1bcwebdav.interfaces\nIWriteLock\nq\x1ccOFS.interfaces\nIZopeObject\nq\x1dczope.interface\nInterface\nq\x1ecplone.supermodel.model\nSchema\nq\x1fcplone.dexterity.schema.generated\nlexikon_4_lexikon_0_Collection\nq t\x85q!.'
INFO:zodbverify:Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/src/zodbverify/src/zodbverify/verify.py", line 61, in verify_record
    unpickler.load()
  File "/Development/Plone/coredev52multipy/src/plone.alterego/plone/alterego/dynamic.py", line 26, in __getattr__
    self.__name__,
AttributeError: Cannot find dynamic object factory for module plone.dexterity.schema.generated

    0: \x80 PROTO      2
    2: (    MARK
    3: c        GLOBAL     'zope.location.interfaces ILocation'
   39: q        BINPUT     2
   41: c        GLOBAL     'plone.app.lockingbehavior.behaviors ILocking'
   87: q        BINPUT     3
   89: c        GLOBAL     'OFS.interfaces IManageable'
  117: q        BINPUT     4
  119: c        GLOBAL     'Products.CMFCore.interfaces._content IMinimalDublinCore'
  176: q        BINPUT     5
  178: c        GLOBAL     'Products.CMFCore.interfaces._content IMutableDublinCore'
  235: q        BINPUT     6
  237: c        GLOBAL     'Products.CMFCore.interfaces._content IMutableMinimalDublinCore'
  301: q        BINPUT     7
  303: c        GLOBAL     'plone.app.content.interfaces INameFromTitle'
  348: q        BINPUT     8
  350: c        GLOBAL     'Products.CMFCore.interfaces._content IOpaqueItemManager'
  407: q        BINPUT     9
  409: c        GLOBAL     'AccessControl.interfaces IOwned'
  442: q        BINPUT     10
  444: c        GLOBAL     'AccessControl.interfaces IPermissionMappingSupport'
  496: q        BINPUT     11
  498: c        GLOBAL     'persistent.interfaces IPersistent'
  533: q        BINPUT     12
  535: c        GLOBAL     'App.interfaces IPersistentExtra'
  568: q        BINPUT     13
  570: c        GLOBAL     'OFS.interfaces IPropertyManager'
  603: q        BINPUT     14
  605: c        GLOBAL     'plone.app.relationfield.behavior IRelatedItems'
  653: q        BINPUT     15
  655: c        GLOBAL     'plone.app.contenttypes.behaviors.richtext IRichText'
  708: q        BINPUT     16
  710: c        GLOBAL     'AccessControl.interfaces IRoleManager'
  749: q        BINPUT     17
  751: c        GLOBAL     'plone.contentrules.engine.interfaces IRuleAssignable'
  805: q        BINPUT     18
  807: c        GLOBAL     'Products.CMFDynamicViewFTI.interfaces ISelectableBrowserDefault'
  872: q        BINPUT     19
  874: c        GLOBAL     'OFS.interfaces ISimpleItem'
  902: q        BINPUT     20
  904: c        GLOBAL     'Products.CMFPlone.interfaces.syndication ISyndicatable'
  960: q        BINPUT     21
  962: c        GLOBAL     'plone.app.contenttypes.behaviors.collection ISyndicatableCollection'
 1031: q        BINPUT     22
 1033: c        GLOBAL     'plone.locking.interfaces ITTWLockable'
 1072: q        BINPUT     23
 1074: c        GLOBAL     'OFS.interfaces ITraversable'
 1103: q        BINPUT     24
 1105: c        GLOBAL     'plone.uuid.interfaces IUUIDAware'
 1139: q        BINPUT     25
 1141: c        GLOBAL     'App.interfaces IUndoSupport'
 1170: q        BINPUT     26
 1172: c        GLOBAL     'Products.CMFCore.interfaces._content IWorkflowAware'
 1225: q        BINPUT     27
 1227: c        GLOBAL     'webdav.interfaces IWriteLock'
 1257: q        BINPUT     28
 1259: c        GLOBAL     'OFS.interfaces IZopeObject'
 1287: q        BINPUT     29
 1289: c        GLOBAL     'zope.interface Interface'
 1315: q        BINPUT     30
 1317: c        GLOBAL     'plone.supermodel.model Schema'
 1348: q        BINPUT     31
 1350: c        GLOBAL     'plone.dexterity.schema.generated lexikon_4_lexikon_0_Collection'
 1415: q        BINPUT     32
 1417: t        TUPLE      (MARK at 2)
 1418: \x85 TUPLE1
 1419: q    BINPUT     33
 1421: .    STOP
highest protocol among opcodes = 2
[3] > /Development/Plone/coredev52multipy/src/zodbverify/src/zodbverify/verify.py(82)verify_record()
-> msg = "{}: {}".format(e.__class__.__name__, str(e))
(Pdb++) c
INFO:zodbverify:
Could not process <type 'BTrees.OIBTree.OISet'> record '\x00\x00\x00\x00\x00\x12X\x0c':
INFO:zodbverify:BTrees.OIBTree.OISet
INFO:zodbverify:'\x80\x02cBTrees.OIBTree\nOISet\nq\x01.\x80\x02(czope.location.interfaces\nILocation\nq\x02cplone.app.lockingbehavior.behaviors\nILocking\nq\x03cOFS.interfaces\nIManageable\nq\x04cProducts.CMFCore.interfaces._content\nIMinimalDublinCore\nq\x05cProducts.CMFCore.interfaces._content\nIMutableDublinCore\nq\x06cProducts.CMFCore.interfaces._content\nIMutableMinimalDublinCore\nq\x07cplone.app.content.interfaces\nINameFromTitle\nq\x08cProducts.CMFCore.interfaces._content\nIOpaqueItemManager\nq\tcAccessControl.interfaces\nIOwned\nq\ncAccessControl.interfaces\nIPermissionMappingSupport\nq\x0bcpersistent.interfaces\nIPersistent\nq\x0ccApp.interfaces\nIPersistentExtra\nq\rcOFS.interfaces\nIPropertyManager\nq\x0ecplone.app.relationfield.behavior\nIRelatedItems\nq\x0fcplone.app.contenttypes.behaviors.richtext\nIRichText\nq\x10cAccessControl.interfaces\nIRoleManager\nq\x11cplone.contentrules.engine.interfaces\nIRuleAssignable\nq\x12cProducts.CMFDynamicViewFTI.interfaces\nISelectableBrowserDefault\nq\x13cOFS.interfaces\nISimpleItem\nq\x14cplone.locking.interfaces\nITTWLockable\nq\x15cplone.app.contenttypes.behaviors.tableofcontents\nITableOfContents\nq\x16cOFS.interfaces\nITraversable\nq\x17cplone.uuid.interfaces\nIUUIDAware\nq\x18cApp.interfaces\nIUndoSupport\nq\x19cProducts.CMFEditions.interfaces\nIVersioned\nq\x1acplone.app.versioningbehavior.behaviors\nIVersioningSupport\nq\x1bcProducts.CMFCore.interfaces._content\nIWorkflowAware\nq\x1ccwebdav.interfaces\nIWriteLock\nq\x1dcOFS.interfaces\nIZopeObject\nq\x1eczope.interface\nInterface\nq\x1fcplone.supermodel.model\nSchema\nq cplone.dexterity.schema.generated\nlexikon_4_lexikon_0_Document\nq!t\x85q".'
INFO:zodbverify:Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/src/zodbverify/src/zodbverify/verify.py", line 61, in verify_record
    unpickler.load()
  File "/Development/Plone/coredev52multipy/src/plone.alterego/plone/alterego/dynamic.py", line 26, in __getattr__
    self.__name__,
AttributeError: Cannot find dynamic object factory for module plone.dexterity.schema.generated

    0: \x80 PROTO      2
    2: (    MARK
    3: c        GLOBAL     'zope.location.interfaces ILocation'
   39: q        BINPUT     2
   41: c        GLOBAL     'plone.app.lockingbehavior.behaviors ILocking'
   87: q        BINPUT     3
   89: c        GLOBAL     'OFS.interfaces IManageable'
  117: q        BINPUT     4
  119: c        GLOBAL     'Products.CMFCore.interfaces._content IMinimalDublinCore'
  176: q        BINPUT     5
  178: c        GLOBAL     'Products.CMFCore.interfaces._content IMutableDublinCore'
  235: q        BINPUT     6
  237: c        GLOBAL     'Products.CMFCore.interfaces._content IMutableMinimalDublinCore'
  301: q        BINPUT     7
  303: c        GLOBAL     'plone.app.content.interfaces INameFromTitle'
  348: q        BINPUT     8
  350: c        GLOBAL     'Products.CMFCore.interfaces._content IOpaqueItemManager'
  407: q        BINPUT     9
  409: c        GLOBAL     'AccessControl.interfaces IOwned'
  442: q        BINPUT     10
  444: c        GLOBAL     'AccessControl.interfaces IPermissionMappingSupport'
  496: q        BINPUT     11
  498: c        GLOBAL     'persistent.interfaces IPersistent'
  533: q        BINPUT     12
  535: c        GLOBAL     'App.interfaces IPersistentExtra'
  568: q        BINPUT     13
  570: c        GLOBAL     'OFS.interfaces IPropertyManager'
  603: q        BINPUT     14
  605: c        GLOBAL     'plone.app.relationfield.behavior IRelatedItems'
  653: q        BINPUT     15
  655: c        GLOBAL     'plone.app.contenttypes.behaviors.richtext IRichText'
  708: q        BINPUT     16
  710: c        GLOBAL     'AccessControl.interfaces IRoleManager'
  749: q        BINPUT     17
  751: c        GLOBAL     'plone.contentrules.engine.interfaces IRuleAssignable'
  805: q        BINPUT     18
  807: c        GLOBAL     'Products.CMFDynamicViewFTI.interfaces ISelectableBrowserDefault'
  872: q        BINPUT     19
  874: c        GLOBAL     'OFS.interfaces ISimpleItem'
  902: q        BINPUT     20
  904: c        GLOBAL     'plone.locking.interfaces ITTWLockable'
  943: q        BINPUT     21
  945: c        GLOBAL     'plone.app.contenttypes.behaviors.tableofcontents ITableOfContents'
 1012: q        BINPUT     22
 1014: c        GLOBAL     'OFS.interfaces ITraversable'
 1043: q        BINPUT     23
 1045: c        GLOBAL     'plone.uuid.interfaces IUUIDAware'
 1079: q        BINPUT     24
 1081: c        GLOBAL     'App.interfaces IUndoSupport'
 1110: q        BINPUT     25
 1112: c        GLOBAL     'Products.CMFEditions.interfaces IVersioned'
 1156: q        BINPUT     26
 1158: c        GLOBAL     'plone.app.versioningbehavior.behaviors IVersioningSupport'
 1217: q        BINPUT     27
 1219: c        GLOBAL     'Products.CMFCore.interfaces._content IWorkflowAware'
 1272: q        BINPUT     28
 1274: c        GLOBAL     'webdav.interfaces IWriteLock'
 1304: q        BINPUT     29
 1306: c        GLOBAL     'OFS.interfaces IZopeObject'
 1334: q        BINPUT     30
 1336: c        GLOBAL     'zope.interface Interface'
 1362: q        BINPUT     31
 1364: c        GLOBAL     'plone.supermodel.model Schema'
 1395: q        BINPUT     32
 1397: c        GLOBAL     'plone.dexterity.schema.generated lexikon_4_lexikon_0_Document'
 1460: q        BINPUT     33
 1462: t        TUPLE      (MARK at 2)
 1463: \x85 TUPLE1
 1464: q    BINPUT     34
 1466: .    STOP
highest protocol among opcodes = 2
[3] > /Development/Plone/coredev52multipy/src/zodbverify/src/zodbverify/verify.py(82)verify_record()
-> msg = "{}: {}".format(e.__class__.__name__, str(e))
(Pdb++) c
INFO:zodbverify:Done! Scanned 251029 records. 
Found 2 records that could not be loaded. 
Exceptions and how often they happened: 
AttributeError: Cannot find dynamic object factory for module plone.dexterity.schema.generated: 2

My Question: What is the next Step? How can i find the Object wich produce this Error. I' not so familiar with low-level Zope. Have anyone a hint? This my first Attempt of an Inline Migration to Py3 and i have a lot of Sites for which I have to do that.

Update:

I have patched zodbverify entrypoint.py with my Mountpoint:

def zopectl_entry(self, arg):
    options = parser.parse_args(arg.split(" ") if arg else [])
    # print(options)
    logging.basicConfig(level=logging.INFO)
    make_wsgi_app({}, self.options.configfile)
    app = Zope2.app()
    # my own Mountpoint with a seperat Data.fs
    app = app['lexikon']
    verify_zodb(app._p_jar._db._storage, debug=options.debug)

and run

 py2/bin/instance zodbverify

Surprise!

2019-07-22 12:16:58,073 INFO    [zodbverify:23][MainThread] Scanning ZODB...
2019-07-22 12:17:06,928 INFO    [zodbverify:49][MainThread] Done! Scanned 251029 records. 
Found 0 records that could not be loaded. 
Exceptions and how often they happened:

Ok, i go to the zodbupdate Section. I copy my Data.fs and the Blobstorage to my Py3 Enviromtent.

and run

./py3/bin/zodbupdate --dry-run --convert-py3 --file=./py3/var/lexikon/filestorage/Data.fs --encoding utf8 --encoding-fallback latin1

and surprise, an error occurs:

loading index
UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in position 25: ordinal not in range(128)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/py3/eggs/ZODB-5.5.1-py3.7.egg/ZODB/FileStorage/FileStorage.py", line 465, in _restore_index
    info = fsIndex.load(index_name)
  File "/Development/Plone/coredev52multipy/py3/eggs/ZODB-5.5.1-py3.7.egg/ZODB/fsIndex.py", line 134, in load
    v = unpickler.load()
SystemError: <built-in method read of _io.BufferedReader object at 0x7fa9f5827938> returned a result with an error set
Traceback (most recent call last):
  File "./py3//bin/zodbupdate", line 266, in <module>
    sys.exit(zodbupdate.main.main())
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/main.py", line 197, in main
    storage = ZODB.FileStorage.FileStorage(args.file)
  File "/Development/Plone/coredev52multipy/py3/eggs/ZODB-5.5.1-py3.7.egg/ZODB/FileStorage/FileStorage.py", line 306, in __init__
    read_only=read_only,
  File "/Development/Plone/coredev52multipy/py3/eggs/ZODB-5.5.1-py3.7.egg/ZODB/FileStorage/FileStorage.py", line 1619, in read_index
    raise FileStorageFormatError(name)
ZODB.FileStorage.FileStorage.FileStorageFormatError: ./py3/var/lexikon/filestorage/Data.fs

Update

I remove the Data.fs.index, Data.fs.lock, Data.fs.tmp and i run a the script without dry-run option

./py3/bin/zodbupdate --convert-py3 --file=./py3/var/lexikon/filestorage/Data.fs --encoding utf8 --encoding-fallback latin1
Updating magic marker for ./py3/var/lexikon/filestorage/Data.fs
Loaded 1 rename rules from OFS:renames
Loaded 13 decode rules from OFS:decodes
Loaded 2 decode rules from AccessControl:decodes
Loaded 3 decode rules from Products.PythonScripts:decodes
Loaded 1 decode rules from Products.ZopeVersionControl:decodes
Class Products.CMFFormController.ControllerPythonScript.ControllerPythonScript has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
Class Products.CMFFormController.ControllerValidator.ControllerValidator has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
New implicit rule detected copy_reg _reconstructor to copyreg _reconstructor
New implicit rule detected __builtin__ object to builtins object
Warning: Missing factory for webdav.EtagSupport EtagBaseInterface
New implicit rule detected Products.CMFCore.interfaces._content ICatalogAware to Products.CMFCore.interfaces ICatalogAware
New implicit rule detected Products.CMFCore.interfaces._content ICatalogableDublinCore to Products.CMFCore.interfaces ICatalogableDublinCore
New implicit rule detected Products.CMFCore.interfaces._content IContentish to Products.CMFCore.interfaces IContentish
Warning: Missing factory for webdav.interfaces IDAVResource
New implicit rule detected Products.CMFCore.interfaces._content IDublinCore to Products.CMFCore.interfaces IDublinCore
New implicit rule detected Products.CMFCore.interfaces._content IDynamicType to Products.CMFCore.interfaces IDynamicType
Warning: Missing factory for OFS.interfaces IFTPAccess
New implicit rule detected Products.CMFCore.interfaces._content IMinimalDublinCore to Products.CMFCore.interfaces IMinimalDublinCore
New implicit rule detected Products.CMFCore.interfaces._content IMutableDublinCore to Products.CMFCore.interfaces IMutableDublinCore
New implicit rule detected Products.CMFCore.interfaces._content IMutableMinimalDublinCore to Products.CMFCore.interfaces IMutableMinimalDublinCore
New implicit rule detected Products.CMFCore.interfaces._content IOpaqueItemManager to Products.CMFCore.interfaces IOpaqueItemManager
New implicit rule detected Products.CMFCore.interfaces._content IWorkflowAware to Products.CMFCore.interfaces IWorkflowAware
Warning: Missing factory for webdav.interfaces IWriteLock
Warning: Missing factory for plone.dexterity.schema.generated lexikon_4_lexikon_0_Image
Warning: Missing factory for plone.dexterity.schema.generated lexikon_4_lexikon_0_Document
Warning: Missing factory for plone.dexterity.schema.generated lexikon_4_lexikon_0_File
Committing changes (#1).
Committing changes (#2).
An error occured
Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/py3/eggs/zope.interface-4.6.0-py3.7-linux-x86_64.egg/zope/interface/declarations.py", line 269, in implementedByFallback
    bases = cls.__bases__
AttributeError: 'ZODBReference' object has no attribute '__bases__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/main.py", line 214, in main
    updater()
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/update.py", line 82, in __call__
    new = self.processor.rename(current)
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/serialize.py", line 333, in rename
    data = unpickler.load()
  File "/Development/Plone/coredev52multipy/py3/eggs/zope.interface-4.6.0-py3.7-linux-x86_64.egg/zope/interface/declarations.py", line 272, in implementedByFallback
    raise TypeError("ImplementedBy called for non-factory", cls)
TypeError: ('ImplementedBy called for non-factory', <zodbupdate.serialize.ZODBReference object at 0x7f1f01c880b8>)
Stopped processing, due to: ('ImplementedBy called for non-factory', <zodbupdate.serialize.ZODBReference object at 0x7f1f01c880b8>)
Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/py3/eggs/zope.interface-4.6.0-py3.7-linux-x86_64.egg/zope/interface/declarations.py", line 269, in implementedByFallback
    bases = cls.__bases__
AttributeError: 'ZODBReference' object has no attribute '__bases__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/main.py", line 214, in main
    updater()
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/update.py", line 82, in __call__
    new = self.processor.rename(current)
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/serialize.py", line 333, in rename
    data = unpickler.load()
  File "/Development/Plone/coredev52multipy/py3/eggs/zope.interface-4.6.0-py3.7-linux-x86_64.egg/zope/interface/declarations.py", line 272, in implementedByFallback
    raise TypeError("ImplementedBy called for non-factory", cls)
TypeError: ('ImplementedBy called for non-factory', <zodbupdate.serialize.ZODBReference object at 0x7f1f01c880b8>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./py3//bin/zodbupdate", line 266, in <module>
    sys.exit(zodbupdate.main.main())
  File "/Development/Plone/coredev52multipy/py3/eggs/zodbupdate-1.2-py3.7.egg/zodbupdate/main.py", line 218, in main
    raise AssertionError()
AssertionError

Hmm... i'm little helpless.

Update:

I found two Images in a Folder that raises this Error

TypeError("ImplementedBy called for non-factory", cls)

mysterious :roll_eyes:

I delete this two Images, an the zodbupdate runs without Errors.

Ok, i'm now on Plone 5.2 with Python3, but "delete Content-Items" can't be the solution.

AttributeError: Cannot find dynamic object factory for module plone.dexterity.schema.generated

I see this too. This is because no zcml is loaded by the zodbverify script (and probably also not by the zodbupdate script). So this utility from plone.dexterity/configure.zcml is not registered:

<utility
    factory=".schema.SchemaModuleFactory"
    name="plone.dexterity.schema.generated"
    />

This utility implements plone.alterego.interfaces.IDynamicObjectFactory. Apparently this utility is needed when determining the dynamic schema of a dexterity item.

I have fixed this in a patch by registering this utility in Python code. Note that in normal use (bin/instance) this would result in a double registration, but the second one is simply ignored by zope.interface, because it is the same. So it should be safe. Code is:

from plone.dexterity.schema import SchemaModuleFactory
from zope.component.hooks import getSiteManager
sm = getSiteManager()
sm.registerUtility(factory=SchemaModuleFactory, name="plone.dexterity.schema.generated")

Another error that we both saw:

ZODB.FileStorage.FileStorage.FileStorageFormatError

Rather unexpectedly, this is caused by the --dry-run option of the zodbverify script, as you seem to have noticed too.

@mauritsvanrees Shouldn't this be part of zodbverify or another add-on that we can easily drop-in to our buildout?

Plone Foundation Code of Conduct