Quantcast
Channel: Planet Plone - Where Developers And Integrators Write
Viewing all articles
Browse latest Browse all 3535

Fred van Dijk: Products.CacheSetup 1.2.1 not compatible with Plone 3.3.5

$
0
0

If you are working on a Plone 3 site and are configuring cache setting using Products.Cachesetup, be warned that the latest release might give you some grey hairs.

After installing CacheSetup 1.2.1 on a production Plone and going to the Control Panel I ran into a traceback when visiting the rules page: a str object does not have a text attirbute. Quick solution:

  • Uninstall CacheSetup
  • Remove portal_cache_settings from your Plone directory if it’s still there
  • Make sure your site is using a CacheSetup trunk version after @146125 or a version hight than 1.2.1 if it’s out.
  • Reinstall Cachesetup

The problem: CacheSetup has both old python install code in Extensions/install.py and GS cachesettings.xml profiles to create the portal_cache_settings folder with 2 predefined caching policies. The vary_expression field  somehow get’s set to the default string value set in the Archetypes schema instead of an Expression. Check Stefan Holek’s fix he made on trunk on October 13th. I ran into the issue on the 15th andI checked for new releases but didn’t dive into svn trunk. So lesson learned: check SVN trunk of a package first if you run into any problems with it.

What baffled me and my colleague Maurit is why this is showing up now, both Plone 3 and CacheSetup are in maintenance mode, nothing big has changed in Plone 3 for the last 10 months. Our best guess is that most installed Plone 3 sites already have an older portal_cache_settings folder which is untouched upon upgrading or activating and everybody is playing with Plone 4.

Note: CacheSetup is not to be used with Plone 4, there’s  plone.app.caching and friends for that.

The full traceback: for those using search for this problem:

http://127.0.0.1:8084/********/portal_cache_settings/with-caching-proxy/rules/cache_policy_item_config
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 31, in _call
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 216, in _exec
Module Products.CacheSetup.patch_cmf, line 51, in FSPT_pt_render
Module Products.Gloworm, line 28, in pt_render
Module zope.pagetemplate.pagetemplate, line 117, in pt_render
- Warning: Macro expansion failed
- Warning: exceptions.KeyError: ‘folder_macros’
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 891, in do_useMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 891, in do_useMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 949, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 949, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 855, in do_condition
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 891, in do_useMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 861, in do_defineMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 855, in do_condition
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 824, in do_loop_tal
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
- URL: file:/Users/fred/cache-buildout/plone3/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/skins/plone_deprecated/old_folder_contents.pt
- Line 136, Column 19
- Expression: <PathExpr standard:u’item/getObjSize’>
- Names:
{‘container’: <PloneSite at /**********>,
‘context’: <RuleFolder at /**********/portal_cache_settings/with-caching-proxy/rules>,
‘default’: <object object at 0x10031d200>,
‘here’: <RuleFolder at /**********/portal_cache_settings/with-caching-proxy/rules>,
‘loop’: {u’item’: <Products.PageTemplates.Expressions.PathIterator object at 0x10cf40ed0>},
‘nothing’: None,
‘options’: {‘args’: (),
‘state’: <Products.CMFFormController.ControllerState.ControllerState object at 0x10c3f8610>},
‘repeat’: <Products.PageTemplates.Expressions.SafeMapping object at 0x10c41fbd8>,
‘request’: <HTTPRequest, URL=http://127.0.0.1:8084/**********/portal_cache_settings/with-caching-proxy/rules/cache_policy_item_config>,
‘root’: <Application at >,
‘template’: <FSControllerPageTemplate at /**********/cache_policy_item_config used for /officious/portal_cache_settings/with-caching-proxy/rules>,
‘traverse_subpath’: [],
‘user’: <PropertiedUser ‘zestadmin’>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 163, in _eval
Module Products.PageTemplates.Expressions, line 113, in render
Module Products.PageTemplates.ZRPythonExpr, line 81, in call_with_ns
Module Products.CMFCore.FSPythonScript, line 135, in __render_with_namespace__
Module Shared.DC.Scripts.Bindings, line 327, in __render_with_namespace__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 196, in _exec
Module None, line 17, in getObjSize
- <FSPythonScript at /**********/getObjSize used for /**********/portal_cache_settings/with-caching-proxy/rules/plone-content-types>
- Line 17
Module Products.Archetypes.BaseObject, line 590, in get_size
Module Products.Archetypes.Field, line 820, in get_size
Module Products.Archetypes.Field, line 731, in getRaw
Module Products.Archetypes.utils, line 162, in mapply
Module Products.CacheSetup.content.base_cache_rule, line 311, in getVaryExpression
AttributeError: ‘str’ object has no attribute ‘text’

Viewing all articles
Browse latest Browse all 3535

Trending Articles