Upgrade 6.0a4 -> 6.0a6 fails (catalog metadata step)

While upgrading from Plone 6 alpha4 to alpha6 I got:

2022-07-20 12:18:18,068 INFO    [plone.app.upgrade:348][waitress-2] Added image_scales column to catalog metadata schema.
2022-07-20 12:18:18,069 INFO    [plone.app.upgrade:360][waitress-2] Updating metadata.
2022-07-20 12:18:18,082 INFO    [ProgressHandler:74][waitress-2] Process started (836 objects to go)
2022-07-20 12:18:18,083 ERROR   [plone.app.upgrade:38][waitress-2] <CatalogTool at portal_catalog>
Traceback (most recent call last):
  File "/home/jensens/.buildout/eggs/cp39/plone.app.upgrade-3.0.0b2-py3.9.egg/plone/app/upgrade/utils.py", line 394, in update_catalog_metadata
    wrapper = getMultiAdapter((obj, catalog), IIndexableObject)
  File "/home/jensens/.buildout/eggs/cp39/zope.component-5.0.1-py3.9.egg/zope/component/_api.py", line 104, in getMultiAdapter
    raise ComponentLookupError(objects, interface, name)
zope.interface.interfaces.ComponentLookupError: ((<CatalogTool at /Plone/portal_catalog>, <CatalogTool at /Plone/portal_catalog>), <InterfaceClass Products.CMFCore.interfaces.IIndexableObject>, '')
[1] > /home/jensens/.buildout/eggs/cp39/zope.component-5.0.1-py3.9.egg/zope/component/_api.py(104)getMultiAdapter()
-> raise ComponentLookupError(objects, interface, name)
(Pdb++) objects, interface, name
((<CatalogTool at /Plone/portal_catalog>, <CatalogTool at /Plone/portal_catalog>), <InterfaceClass Products.CMFCore.interfaces.IIndexableObject>, '')

It looks like it tries somehow to index the catalog itself, or am I wrong?

I have seen the same, and have even aded this in a comment in the above code. The upgrade should just log this and then continue.

I did not raise more alarms when writing this code, because I have seen it before. Ah, I have found an earlier report by myself from July last year. But in November I could no longer reproduce it:

If I interpret this report correctly, in some Plone 5.2 version there was a problem where a clear and rebuild of the catalog had the side effect of adding a brain for the portal_catalog itself. This should no longer happen, but on existing sites you could still have this problem.

Should be fine to manually go to the portal_catalog and remove this brain. Maybe add an upgrade step in plone.app.upgrade.

I patched that already in the past:

It might be that my patch is not valid anymore for some reason.

Wait a sec, my the patch is relevant only for the clearFindAndRebuild method.

Most probably the same check (obj != self, where self is the portal_catalog) should be also added in some other place (e.g. the indexObject or the reindexObject methods of the catalog tool).

1 Like