Troubleshooting Plone caching with CacheFu

How to fix page rendering errors and other cache-related problems in Plone 3 and the CacheFu caching Product (version 1.1).

After upgrading my Plone 2.5.5 site to version 3.0, I had a bunch of problems with object rendering and caching. With a ton of help from Ricardo Newbery, I was able to fight through these problems and get CacheFu (and my Plone site) working properly again. I hope this information will help you as well, should you run into any similar problems with your Plone site.

For more specifics on the problems, please see these Plone forum threads:

Here are the detailed errors I ran into, and the fixes for each:


The error: ‘NoneType’ object has no attribute ‘get’

The trigger: This error occurred after I tried to uninstall CacheFu, and then re-install it via Plone’s Add/Remove Products configuration page.

The solution: It was necessary to modify either one (or both) of two sets of CacheFu product files on the file system:

  • $PLONE_HOME/zeocluster/Products/CMFSquidTool/SquidTool.py and $PLONE_HOME/zeocluster/Products/CMFSquidTool/tests/test_tool.py (code fix detailed here)
  • $PLONE_HOME/zeocluster/Products/CacheSetup/Extensions/utils.py
    The fix here is to comment out line 82, or the following line:

    cache_tool.unindexObject()

The error: Name not found: LanguageToolFlags (and other layer names)

The trigger: This error occurred while troubleshooting earlier steps and playing with portal skins to fix rendering errors.

The solution: In the Zope Management Interface (ZMI), in /portal_skins/manage_propertiesForm, in the list of skin layers, find the offending skin name (in this case, LanguageToolFlags), delete it from the list, and then click Save. It’s very likely that you’ll have to do this more than once before the error is resolved; in my case, I had to remove seven or eight layer entries before the site would render error-free.


The error: name ‘allow_tabbing’ is not defined

The trigger: After performing the above troubleshooting steps, just trying to access the Cache Configuration Tool in Plone’s Site Setup caused the error.

The solution: This problem required another manual edit of two CacheFu product files on the file system:

  • $PLONE_HOME/zeocluster/Products/CacheSetup/skins/cache_setup/cache_setup_items_config.pt and
    $PLONE_HOME/zeocluster/Products/CacheSetup/skins/cache_setup/cache_tool_config.cpt
    (code fix detailed here)

The error: AttributeError: portal_types

The trigger: Again, after doing the above, just trying to access the Cache Configuration Tool in Plone’s Site Setup caused the error.

The solution: First, make sure you take a backup of your database file (Data.fs or other, depending on your data storage) before trying any of this! It’s highly experimental and can damage your site … it could also fix it, however, and backing up your data before trying anything is never a bad idea.That said, here is the procedure that worked for me:

  1. In the ZMI, in /portal_quickinstaller, click the Contents tab.
  2. Deleting these CacheFu-related product objects in this tab:
    • CMFSquidTool
    • CacheSetup
  3. In the ZMI, at the site root (/), manually delete these CacheFu-related objects:
    • caching_policy_manager
    • portal_cache_settings
    • portal_squid
  4. In the ZMI, in /portal_skins/manage_propertiesForm, delete the cache_setup layer from the list of skin layers, and click Save.
    As mentioned above, you may need to delete more than one skin layer (usually including LanguageToolFlags) before you can save without an error.
  5. Restart your Zope instance:
    $PLONE_HOME/zeocluster/bin/restartcluster.sh
  6. In the ZMI, in /portal_quickinstaller, select CacheSetup and then click Install.
  7. If this works (and it should!), you should be able to proceed to the Cache Configuration Tool in Plone’s Site Setup to enable CacheFu and put the finishing touches on your caching configuration.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s