Policy package activation error due to catalog.xml entries

I have a site with the following versions:
Plone 5.1.4 (5114)
CMF 2.2.12
Zope 2.13.27
Python 2.7.16 (default, May 9 2019, 21:21:03) [GCC 4.8.4]
PIL 5.2.0 (Pillow)
ZODB 5.3.0

My catalog.xml contains:

<?xml version="1.0"?>
<object name="portal_catalog">
  <column value="organisation"/>
  <index name="organisation" meta_type="ZCTextIndex">
    <indexed_attr value="organisation"/>
    <extra name="index_type" value="Okapi BM25 Rank"/>
    <extra name="lexicon_id" value="plone_lexicon"/>
  </index>  
</object>

If I activate the package I get the following error message:

  Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 689, in __call__
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 454, in install_product
  Module Products.GenericSetup.tool, line 388, in runAllImportStepsFromProfile
   - __traceback_info__: profile-aawardsph.policy:default
  Module Products.GenericSetup.tool, line 1469, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1281, in _doRunImportStep
   - __traceback_info__: catalog
  Module Products.CMFCore.exportimport.catalog, line 31, in importCatalogTool
  Module Products.GenericSetup.utils, line 849, in importObjects
   - __traceback_info__: portal_catalog
  Module Products.GenericSetup.utils, line 512, in _importBody
  Module Products.GenericSetup.ZCatalog.exportimport, line 69, in _importNode
  Module Products.GenericSetup.ZCatalog.exportimport, line 146, in _initColumns
  Module Products.ZCatalog.ZCatalog, line 885, in addColumn
  Module Products.ZCatalog.Catalog, line 195, in addColumn
  Module Products.ZCatalog.ProgressHandler, line 54, in report
  Module transaction._manager, line 147, in savepoint
  Module transaction._transaction, line 228, in savepoint
  Module transaction._transaction, line 344, in _saveAndRaiseCommitishError
  Module transaction._transaction, line 225, in savepoint
  Module transaction._transaction, line 713, in __init__
  Module ZODB.Connection, line 1000, in savepoint
  Module ZODB.Connection, line 547, in _commit
  Module ZODB.Connection, line 579, in _store_objects
  Module ZODB.serialize, line 419, in serialize
  Module ZODB.serialize, line 428, in _dump
  Module zodbpickle.pickle_2, line 233, in dump
  Module zodbpickle.pickle_2, line 295, in save
  Module zodbpickle.pickle_2, line 557, in save_tuple
  Module zodbpickle.pickle_2, line 295, in save
  Module zodbpickle.pickle_2, line 571, in save_tuple
  Module zodbpickle.pickle_2, line 295, in save
  Module zodbpickle.pickle_2, line 571, in save_tuple
  Module zodbpickle.pickle_2, line 326, in save
  Module zodbpickle.pickle_2, line 762, in save_global
  Module zodbpickle.pickle_2, line 834, in whichmodule
  TypeError: unhashable type: 'Missing.Missing'

If I comment out the entries, the activation of the policy package proceeds.

This is on a staging server which has a copy of the production database.

BTW, is it still true that a reactivation of catalog.xml will succeed but will also delete existing records for that index (like a reset)? Is this the same for metadata?

I have observed Missing problems caused by an outdated version of this package. Try to upgrade to a newer version and see whether the problem disappears.

Thanks. I upgrade the version to 4.1 from 3.2. The error is now gone.

BTW, before the upgrade, I also experienced the error in deleting an old member folder type which has now been replaced. This site's python was upgraded from an old version to 2.7.16. I thought that the package was using C extensions and it needed to be recompiled for the new python version. Recompilation was a requirement of other packages. However, it did not work. The version upgrade solved it.

Update: The real problem could be because zodbpickle, was compiled using an old python version and the buildout python version is newer. This package uses C extensions so it needs to be recompiled if the buildout uses a new python version.

If not fixed, zeopacking will not work. See my related post Tuple assignment error on zeopack.