Plone is not working very well when portal_catalog is not up-to-date. This happens after upgrades. It is recommended to go to portal_catalog, section Advanced and run: Clear and Rebuild.
I did this, but after few seconds I’ve got this fancy error:
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFPlone.CatalogTool, line 460, in manage_catalogRebuild
Module plone.app.discussion.patches, line 45, in patchedClearFindAndRebuild
Module Products.ZCatalog.ZCatalog, line 287, in manage_catalogClear
Module Products.ZCatalog.Catalog, line 102, in clear
If you dig deep down into ZCatalog code, then you’ll see that some objects in DB simply don’t have clear method. Those objects are typically some ancient instances of TextIndex or instance of some long dead product.
Solution is to catch this error and remove those old grumpy objects from DB. Here is small patch:
""" clear catalog """
self.data = IOBTree() # mapping of rid to meta_data
self.uids = OIBTree() # mapping of uid to rid
self.paths = IOBTree() # mapping of rid to uid
self._length = BTrees.Length.Length()
to_delete = 
for index in self.indexes.keys():
LOG.error('unclearable object %s. ' % str(index))
for del_index in to_delete:
LOG.error('Removing from index %s. ' % str(del_index))
Remove eggs/Products.ZCatalog-2.13.23-py2.7.egg/Products/ZCatalog/Catalog.pyc file to avoid caching. Start the Plone and run Clear and Rebuild function. Watch log file also for error messages from ZCatalog.
If you want to upgrade Plone just with buildout, then you may find following funny error:
Error: There is a version conflict.
We already have: zc.buildout 1.5.2
Typical cause of this problem is that your bin/buildout is out of date. Solution is simple. Remove bin directory. Download latest version of bootstrap.py and let it generate new version of bin/buildout for you. Run biuldout again
I’m glad that I had opportunity to join Startup Camp in Trhový Štěpánov as mentor. Together with startup teams we were discussing and preparing new sites for their products. People were learning how to use Git, how to program in Python and how to create sites in Django. At the end of the day they were able to create prototype or deploy it to Heroku cloud.
Then you can exclude psycopg2 from pip install command, because it is installed in system directory of Python.
Another tricky issue is with command:
pip freeze >requirements.txt
If you type this command in PowerShell then it will automatically create Unicode file with extra bytes. When you try to deploy project with messed requirements.txt to Herou then you’ll see self explanatory error
TypeError: must be encoded string without NULL bytes, not str
Just open requirements.txt file with notepad and select Save as. In Save as dialog choose ANSI.
Commit file and push project to Heroku. It will work