Upgrading to 3.0

In which, again, Plone makes something simple complicated.

Despite the Plone community's tendency to dump everything and jump onto the latest version, I'd resisted the move to Plone 3.0. One good reason for this is that I'd repeatedly installed Plone 3.0 and it had - repeatedly - failed to startup. The symptoms weren't identical every time, but most commonly showed Plone failing to import or find a common submodule. For example:

[agapow@iBook ~/Sites/zope-2.10.5-final]$ ./bin/runzope -X
"debug-mode=on" 2008-02-04 14:35:23 INFO ZServer HTTP server started at
Mon Feb 4 14:35:23 2008 Hostname: 0.0.0.0 Port: 8080 2008-02-04 14:35:27
ERROR PortalTransforms Problem importing module
web_intelligent_plain_text_to_html : No module named
intelligenttext.transforms 2008-02-04 14:35:27 ERROR PortalTransforms
Problem importing module html_to_web_intelligent_plain_text : No
module named intelligenttext.transforms 2008-02-04 14:35:29 ERROR
Application Could not import Products.ATContentTypes Traceback (most
recent call last): File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/OFS/Application.py",
line 709, in import_product product=__import__(pname, global_dict,
global_dict, silly) File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/__init__.py",
line 64, in ? import Products.ATContentTypes.content File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/__init__.py",
line 26, in ? import Products.ATContentTypes.content.link File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/link.py",
line 39, in ? from Products.ATContentTypes.content.base import
registerATCT File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/base.py",
line 63, in ? from Products.CMFPlone.PloneFolder import
ReplaceableWrapper File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/__init__.py",
line 215, in ? from browser import ploneview File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/browser/ploneview.py",
line 12, in ? from Products.CMFPlone import utils File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/utils.py", line
7, in ? from plone.i18n.normalizer.interfaces import IIDNormalizer
ImportError: No module named i18n.normalizer.interfaces Traceback (most
recent call last): File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/Startup/run.py",
line 56, in ? run() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/Startup/run.py",
line 21, in run starter.prepare() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/Startup/__init__.py",
line 102, in prepare self.startZope() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/Startup/__init__.py",
line 278, in startZope Zope2.startup() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/__init__.py",
line 47, in startup _startup() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/Zope2/App/startup.py",
line 45, in startup OFS.Application.import_products() File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/OFS/Application.py",
line 686, in import_products import_product(product_dir,
product_name, raise_exc=debug_mode) File
"/Users/agapow/Applications/bin/zope-2.10.5-final/lib/python/OFS/Application.py",
line 709, in import_product product=__import__(pname, global_dict,
global_dict, silly) File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/__init__.py",
line 64, in ? import Products.ATContentTypes.content File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/__init__.py",
line 26, in ? import Products.ATContentTypes.content.link File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/link.py",
line 39, in ? from Products.ATContentTypes.content.base import
registerATCT File
"/Users/agapow/Sites/zope-2.10.5-final/Products/ATContentTypes/content/base.py",
line 63, in ? from Products.CMFPlone.PloneFolder import
ReplaceableWrapper File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/__init__.py",
line 215, in ? from browser import ploneview File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/browser/ploneview.py",
line 12, in ? from Products.CMFPlone import utils File
"/Users/agapow/Sites/zope-2.10.5-final/Products/CMFPlone/utils.py", line
7, in ? from plone.i18n.normalizer.interfaces import IIDNormalizer
ImportError: No module named i18n.normalizer.interfaces

Got all of that? Marvellous - you now have a small understanding of what Plone development is like: routine operations being interupted by enormous cryptic tracebacks.

At one point, I'd found that several zope packages I had in my standard Python library site-packages were causing the problem, being loaded instead of those in the instance library. (Those in site-packages were more up-to-date that those in the instance. Backwards compatiability? What's that?) . This is despite the fact the PYTHONPATH for Zope was set to look at the instance library first. Clearing out the zope packages fixed things.

Some minor revs later, I gave it another try. This time it failed with the above error message, but there were no zope packages in site-packages and none of the paths showed anything be drawn from there. Intrigued, I started up IPython and typed:

[1]: import zope
ImportError: No module named zope
[2]: import Plone
[3]:

Uh-huh. Now it was a Plone module. Searching site-packages, a single package was found, that wasn't even part of the plone distribution but was using the plone namespace. This was enough to throw off the import. Removing that was enough to allow the instance to run. It seems that something like this is the cause of a lot of related problems:

The clean solution is to use a python installation dedicated to nothing but Plone, so that there is no other installed software to interfere with Plone. Suggested solutions in some of the incidents listed above include using a universal installer (doesn't help), a buildout recipe or virtualenv, which puts me in mind of the Dilbert cartoon about cycling shorts:

Problem: bicycle seats are hard. They hurt.

Analysis: There must be something wrong with your pants.

Solution: Dorky pants.