[solved] Migrate from 5.1.x to 5.2.x -> error in plone.app.widgets

Hi,
I just tried to migrate 5.1-latest to 5.2-latest on py2 but get the following traceback:

2021-12-09 08:50:04,560 ERROR   [plone.app.upgrade:299][waitress-1] Upgrade aborted. Error:
Traceback (most recent call last):
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.CMFPlone-5.2.6-py2.7.egg/Products/CMFPlone/MigrationTool.py", line 292, in upgrade
    step['step'].doStep(setup)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.GenericSetup-2.1.4-py2.7.egg/Products/GenericSetup/upgrade.py", line 168, in doStep
    self.handler(tool)
  File "/Volumes/WORKSPACE2/interreg/eggs/plone.app.upgrade-2.0.41-py2.7.egg/plone/app/upgrade/v52/alphas.py", line 89, in to52alpha1
    loadMigrationProfile(context, 'profile-plone.app.upgrade.v52:to52alpha1')
  File "/Volumes/WORKSPACE2/interreg/eggs/plone.app.upgrade-2.0.41-py2.7.egg/plone/app/upgrade/utils.py", line 203, in loadMigrationProfile
    context.runAllImportStepsFromProfile(profile, purge_old=False)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.GenericSetup-2.1.4-py2.7.egg/Products/GenericSetup/tool.py", line 405, in runAllImportStepsFromProfile
    dependency_strategy=dependency_strategy)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.GenericSetup-2.1.4-py2.7.egg/Products/GenericSetup/tool.py", line 1487, in _runImportStepsFromContext
    message = self._doRunImportStep(step, context)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.GenericSetup-2.1.4-py2.7.egg/Products/GenericSetup/tool.py", line 1299, in _doRunImportStep
    return handler(context)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.CMFPlone-5.2.6-py2.7.egg/Products/CMFPlone/resources/exportimport/bundles.py", line 34, in combine
    combine_bundles(site)
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.CMFPlone-5.2.6-py2.7.egg/Products/CMFPlone/resources/browser/combine.py", line 180, in combine_bundles
    write_js(context, production_folder, 'default')
  File "/Volumes/WORKSPACE2/interreg/eggs/Products.CMFPlone-5.2.6-py2.7.egg/Products/CMFPlone/resources/browser/combine.py", line 120, in write_js
    folder.writeFile(meta_bundle + '.js', fi)
  File "/Volumes/WORKSPACE2/interreg/eggs/plone.resource-2.1.4-py2.7.egg/plone/resource/directory.py", line 163, in writeFile
    f = File(filename, filename, data)
  File "/Volumes/WORKSPACE2/interreg/eggs/Zope-4.6.3-py2.7.egg/OFS/Image.py", line 157, in __init__
    data, size = self._read_data(file)
  File "/Volumes/WORKSPACE2/interreg/eggs/Zope-4.6.3-py2.7.egg/OFS/Image.py", line 617, in _read_data
    transaction.savepoint(optimistic=True)
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_manager.py", line 272, in savepoint
    return self.manager.savepoint(optimistic)
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_manager.py", line 150, in savepoint
    return self.get().savepoint(optimistic)
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_transaction.py", line 228, in savepoint
    self._saveAndRaiseCommitishError()  # reraises!
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_transaction.py", line 316, in _saveAndRaiseCommitishError
    reraise(t, v, tb)
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_transaction.py", line 225, in savepoint
    savepoint = Savepoint(self, optimistic, *self._resources)
  File "/Volumes/WORKSPACE2/interreg/eggs/transaction-3.0.1-py2.7.egg/transaction/_transaction.py", line 626, in __init__
    savepoint = savepoint()
  File "/Volumes/WORKSPACE2/interreg/eggs/ZODB-5.6.0-py2.7.egg/ZODB/Connection.py", line 997, in savepoint
    self._commit(None)
  File "/Volumes/WORKSPACE2/interreg/eggs/ZODB-5.6.0-py2.7.egg/ZODB/Connection.py", line 546, in _commit
    self._store_objects(ObjectWriter(obj), transaction)
  File "/Volumes/WORKSPACE2/interreg/eggs/ZODB-5.6.0-py2.7.egg/ZODB/Connection.py", line 578, in _store_objects
    p = writer.serialize(obj)  # This calls __getstate__ of obj
  File "/Volumes/WORKSPACE2/interreg/eggs/ZODB-5.6.0-py2.7.egg/ZODB/serialize.py", line 430, in serialize
    return self._dump(meta, obj.__getstate__())
  File "/Volumes/WORKSPACE2/interreg/eggs/ZODB-5.6.0-py2.7.egg/ZODB/serialize.py", line 439, in _dump
    self._p.dump(state)
PicklingError: Can't pickle <class 'plone.app.widgets.interfaces.IWidgetsLayer'>: attribute lookup plone.app.widgets.interfaces.IWidgetsLayer failed

which is obvious, because plone.app.widgets.interfaces.IWidgetsLayer was removed since 3.0 ...

Has anybody else this problem and maybe a solution?

Thx

Where's the related issue on GitHub?

If its a browser-layer it should be configured in the olds site ZMI components tab on the Plone site-root, where it can be removed before migration.

Thanks for the tip. I've found the interface in the components tab. Though trying to remove it leads to another traceback when saving the list:

2021-12-09 12:02:27,887 ERROR   [Zope.SiteErrorLog:252][waitress-2] 1639047747.890.331829548938 http://localhost:8080/Plone/manage_components
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 371, in publish_module
  Module ZPublisher.WSGIPublisher, line 274, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.GenericSetup.browser.components, line 74, in __call__
  Module Products.GenericSetup.browser.components, line 70, in update
  Module Products.GenericSetup.browser.components, line 53, in _setBody
  Module Products.GenericSetup.utils, line 557, in _importBody
  Module Products.GenericSetup.components, line 105, in _importNode
  Module Products.GenericSetup.components, line 350, in _initUtilities
TypeError: __init__() takes at least 6 arguments (1 given)

Nevertheless I found out why this browserlayer is listed here. A few years ago the Site was migrated fom Plone 4.3 to 5.1 and so the browserlayer was never removed but the interface still existed in p.a.widgets < 3 ... now since 3.0.x this got removed.

So I make a custom upgrade step which removes the layer ...