説明
開発者はPloneのよくある例外トレースバックパターンに直面する
よくあるエラーの一覧とその解決策
トレースバックの例:
Module zope.tales.tales, line 696, in evaluate
- URL: /home/moo/sits/src/plone.z3cform/plone/z3cform/crud/crud-master.pt
- Line 17, Column 2
- Expression: <PathExpr standard:u'form/render'>
- Names:
{'args': (),
'context': <SitsPatient at /folder_sits/sitsngta/intranet/sitsdatabase/sitscountry_TE/sitshospital_TES/sitspatient.TETES2009062217>,
'default': <object object at 0xb7d76538>,
'loop': {},
'nothing': None,
'options': {},
'repeat': {},
'request': <HTTPRequest, URL=http://localhost:9000/folder_sits/sitsngta/intranet/sitsdatabase/sitscountry_TE/sitshospital_TES/sitspatient.TETES2009062217/@@ar>,
'template': <zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile object at 0xc6e552c>,
'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at 0xf7fb78c>,
'view': <Products.SitsPatient.browser.ar.ARCrudForm object at 0xf928ccc>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xf7b4a0c>}
Module Products.PTProfiler.ProfilerPatch, line 32, in __patched_call__
Module zope.tales.expressions, line 217, in __call__
Module zope.tales.expressions, line 211, in _eval
Module z3c.form.form, line 143, in render
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Shared.DC.Scripts.Bindings, line 1, in ?
Module Shared.DC.Scripts.Bindings, line 293, in _getTraverseSubpath
AttributeError: 'str' object has no attribute 'other'
Fiveの ViewPageTemplate クラスファイルは、Zope3の標準 ViewPageTemplate と少しだけ違います。 この場合、Zope3の標準 ViewPageTemplate 期待されが、Fiveのが使われた。
他の理由として、獲得がカスタムビューを正しくセットアップされていない場合です。
違い:
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
対:
**なぜか原文に書かれていない**
以下のログトレースは、サイトの表示を試みた時に発生するだろう。 しかし、ZMIへはアクセス出来る:
2009-09-23 20:47:18 WARNING OFS.Uninstalled Could not import class 'IPloneCommentsLayer' from module 'quintagroup.plonecomments.interfaces'
2009-09-23 20:47:18 ERROR Zope.SiteErrorLog 1253728038.160.534632167217 http://localhost:9444/XXX
Traceback (innermost last):
Module plone.postpublicationhook.hook, line 65, in publish
Module ZPublisher.BaseRequest, line 424, in traverse
Module ZPublisher.BeforeTraverse, line 99, in __call__
Module Products.CMFCore.PortalObject, line 94, in __before_publishing_traverse__
Module zope.event, line 23, in notify
Module zope.component.event, line 26, in dispatch
Module zope.component._api, line 130, in subscribers
Module zope.component.registry, line 290, in subscribers
Module zope.interface.adapter, line 535, in subscribers
Module zope.component.event, line 33, in objectEventNotify
Module zope.component._api, line 130, in subscribers
Module zope.component.registry, line 290, in subscribers
Module zope.interface.adapter, line 535, in subscribers
Module plone.browserlayer.layer, line 18, in mark_layer
Module zope.interface.declarations, line 848, in directlyProvides
Module zope.interface.declarations, line 1371, in _normalizeargs
Module zope.interface.declarations, line 1370, in _normalizeargs
TypeError: iteration over non-sequence
2009-09-23 20:47:18 ERROR root Exception while rendering an error message
Traceback (most recent call last):
File "/home/moo/XXX/parts/zope2/lib/python/OFS/SimpleItem.py", line 227, in raise_standardErrorMessage
v = s(**kwargs)
File "/home/moo/workspace2/collective.skinny/collective/skinny/patch.py", line 8, in standard_error_message
return self.restrictedTraverse('@@404.html')()
File "/home/moo/workspace2/collective.skinny/collective/skinny/fourohfour.py", line 22, in __call__
return skins.plone_templates.standard_error_message.__of__(
File "/home/moo/XXX/eggs/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/FSPythonScript.py", line 140, in __call__
return Script.__call__(self, *args, **kw)
File "/home/moo/XXX/parts/zope2/lib/python/Shared/DC/Scripts/Bindings.py", line 313, in __call__
return self._bindAndExec(args, kw, None)
File "/home/moo/XXX/parts/zope2/lib/python/Shared/DC/Scripts/Bindings.py", line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/moo/XXX/eggs/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/FSPythonScript.py", line 196, in _exec
result = f(*args, **kw)
File "Script (Python)", line 27, in standard_error_message
AttributeError: default_error_message
これは通常、他のシステムから Data.fs をコピーしてきたことをを意味する。さらに、インストールされた同一のアドオンプロダクトを持っていない。
例:
File "/home/moo/saariselka/parts/zope2/lib/python/zope/tales/expressions.py", line 217, in __call__
return self._eval(econtext)
File "/home/moo/saariselka/parts/zope2/lib/python/Products/PageTemplates/Expressions.py", line 155, in _eval
ob = self._subexprs[-1](econtext)
File "/home/moo/saariselka/parts/zope2/lib/python/zope/tales/expressions.py", line 124, in _eval
ob = self._traverser(ob, element, econtext)
File "/home/moo/saariselka/parts/zope2/lib/python/Products/PageTemplates/Expressions.py", line 85, in boboAwareZopeTraverse
request=request)
File "/home/moo/saariselka/parts/zope2/lib/python/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
- __traceback_info__: ({u'main': [('version', '1.6'), ('mode', 'html'), ('setPosition', (7, 0)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('beginScope', {u'define-macro': u'main'}), ('optTag', (u'metal:main-macro', None, 'metal', 0, [('startTag', (u'metal:main-macro', [(u'define-macro', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1)), ('setPosition', (8, 1)), ('defineSlot', (u'main', [('beginScope', {u'define-slot': u'main'}), ('optTag', (u'metal:main-slot', None, 'metal', 0, [('startTag', (u'metal:main-slot', [(u'define-slot', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1))])), ('endScope', ())])), ('setPosition', (9, 1)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('rawtextColumn', (u'\n', 0))])), ('endScope', ())]}, 'master')
File "/home/moo/saariselka/parts/zope2/lib/python/zope/traversing/adapters.py", line 52, in traverse
raise TraversalError(subject, name)
- __traceback_info__: ({u'main': [('version', '1.6'), ('mode', 'html'), ('setPosition', (7, 0)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('beginScope', {u'define-macro': u'main'}), ('optTag', (u'metal:main-macro', None, 'metal', 0, [('startTag', (u'metal:main-macro', [(u'define-macro', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1)), ('setPosition', (8, 1)), ('defineSlot', (u'main', [('beginScope', {u'define-slot': u'main'}), ('optTag', (u'metal:main-slot', None, 'metal', 0, [('startTag', (u'metal:main-slot', [(u'define-slot', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1))])), ('endScope', ())])), ('setPosition', (9, 1)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('rawtextColumn', (u'\n', 0))])), ('endScope', ())]}, 'master', [])
TraversalError: ({u'main': [('version', '1.6'), ('mode', 'html'), ('setPosition', (7, 0)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('beginScope', {u'define-macro': u'main'}), ('optTag', (u'metal:main-macro', None, 'metal', 0, [('startTag', (u'metal:main-macro', [(u'define-macro', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1)), ('setPosition', (8, 1)), ('defineSlot', (u'main', [('beginScope', {u'define-slot': u'main'}), ('optTag', (u'metal:main-slot', None, 'metal', 0, [('startTag', (u'metal:main-slot', [(u'define-slot', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1))])), ('endScope', ())])), ('setPosition', (9, 1)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('rawtextColumn', (u'\n', 0))])), ('endScope', ())]}, 'master') (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: ({u'main': [('version', '1.6'), ('mode', 'html'), ('setPosition', (7, 0)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('beginScope', {u'define-macro': u'main'}), ('optTag', (u'metal:main-macro', None, 'metal', 0, [('startTag', (u'metal:main-macro', [(u'define-macro', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1)), ('setPosition', (8, 1)), ('defineSlot', (u'main', [('beginScope', {u'define-slot': u'main'}), ('optTag', (u'metal:main-slot', None, 'metal', 0, [('startTag', (u'metal:main-slot', [(u'define-slot', u'main', 'metal')]))], [('rawtextColumn', (u'\n\t', 1))])), ('endScope', ())])), ('setPosition', (9, 1)), ('setSourceFile', 'file:/home/moo/workspace2/collective.skinny/collective/skinny/skins/skinny_faux_layer/main_template.pt'), ('rawtextColumn', (u'\n', 0))])), ('endScope', ())]}, 'master'))
Some template tries to call macro inside another template and the macro is not defined in the target template.
いくつかのテンプレートは、他のテンプレートを内部でマクロ呼び出していて、そのマクロがターゲットテンプレートで定義されていない。
例:
Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module Products.CMFPlone.FactoryTool, line 361, in __call__
Module Products.CMFPlone.FactoryTool, line 147, in __getitem__
Module Products.CMFPlone.PloneFolder, line 406, in invokeFactory
Module Products.CMFCore.TypesTool, line 934, in constructContent
Module Products.CMFCore.TypesTool, line 345, in constructInstance
Module Products.CMFCore.TypesTool, line 357, in _finishConstruction
Module Products.CMFCore.CMFCatalogAware, line 145, in notifyWorkflowCreated
Module Products.CMFCore.WorkflowTool, line 355, in notifyCreated
Module Products.DCWorkflow.DCWorkflow, line 392, in notifyCreated
Module Products.DCWorkflow.DCWorkflow, line 476, in _changeStateOf
Module Products.DCWorkflow.DCWorkflow, line 571, in _executeTransition
Module Products.DCWorkflow.DCWorkflow, line 435, in updateRoleMappingsFor
Module Products.DCWorkflow.utils, line 60, in modifyRolesForPermission
Module AccessControl.Permission, line 93, in setRoles
AttributeError: appname
考えられる理由
例外はクイックインストーラを実行できなくする。
例:
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 589, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 475, in installProduct
- __traceback_info__: ('gomobile.mobile',)
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 396, in snapshotPortal
Module five.localsitemanager.registry, line 194, in registeredUtilities
Module zope.component.registry, line 127, in registeredUtilities
ValueError: too many values to unpack
理由:
Data.fs が zope.component 3.5.1 で使われていたが、その Data.fs がダウングレードされたか、別の場所から移動された。 zope.component はバージョン3.5.1に固定する必要がある。
Example:
2009-10-18 13:11:20 ERROR Zope.SiteErrorLog 1255860680.760.514176531634 http://localhost:8080/twinapex/portal_quickinstaller/installProducts
Traceback (innermost last):
Module ZPublisher.Publish, line 125, in publish
Module Zope2.App.startup, line 238, in commit
Module transaction._manager, line 93, in commit
Module transaction._transaction, line 325, in commit
Module transaction._transaction, line 424, in _commitResources
Module ZODB.Connection, line 541, in commit
Module ZODB.Connection, line 586, in _commit
Module ZODB.Connection, line 620, in _store_objects
Module ZODB.serialize, line 407, in serialize
Module OFS.Uninstalled, line 40, in __getstate__
SystemError: This object was originally created by a product that
is no longer installed. It cannot be updated.
(<Salt at broken>)
Data.fs contains objects for which the code is not present. You have probably moved Data.fs or edited buildout.cfg.
Check that eggs and zcml contain all necessary products in buildout.cfg.
Discussion
Example:
Error in test test_render_form (gomobile.convergence.tests.test_mobile_overrides.TestMobileOverrides)
Traceback (most recent call last):
File "/Users/moo/twinapex/twinapex/parts/zope2/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in __call__
testMethod()
File "/Users/moo/twinapex/twinapex/src/gomobile.convergence/gomobile/convergence/tests/test_mobile_overrides.py", line 65, in test_render_form
result()
File "/Users/moo/twinapex/twinapex/eggs/z3c.form-1.9.0-py2.4.egg/z3c/form/form.py", line 189, in __call__
self.update()
File "/Users/moo/twinapex/twinapex/eggs/z3c.form-1.9.0-py2.4.egg/z3c/form/form.py", line 184, in update
super(Form, self).update()
File "/Users/moo/twinapex/twinapex/eggs/z3c.form-1.9.0-py2.4.egg/z3c/form/form.py", line 134, in update
self.updateWidgets()
File "/Users/moo/twinapex/twinapex/eggs/z3c.form-1.9.0-py2.4.egg/z3c/form/form.py", line 120, in updateWidgets
self.widgets = zope.component.getMultiAdapter(
File "/Users/moo/twinapex/twinapex/eggs/zope.component-3.5.1-py2.4.egg/zope/component/_api.py", line 104, in getMultiAdapter
raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<Products.Five.metaclass.documentoverriderform object at 0x711c6f0>, <HTTPRequest, URL=http://nohost>, <ATDocument at /plone/doc>), <InterfaceClass z3c.form.interfaces.IWidgets>, u'')
Reason: To use z3c.form based forms z3c.form.interfaces.IFormRequest must be enabled for HTTP request object to make form layer adaptions work.
How to fix:
If you get Page not found error when accessing @@manage-portlets the first thing you need to do is to enable logging of NotFound exceptions in ZMI in error_log.
After that reload @@manage-portlets.
When you try to access @@manage-portlets an exception a NotFound exception is raised:
2009-11-09 12:56:13 ERROR Zope.SiteErrorLog 1257764173.180.738005333766 http://localhost:8080/saariselka/@@manage-portlets
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module Products.PageTemplates.Expressions, line 223, in evaluateStructure
...
Module zope.tales.tales, line 696, in evaluate
- URL: file:/Users/moo/workspace/plonetheme.saariselka/plonetheme/saariselka/skins/plonetheme_saariselka_custom_templates/main_template.pt
- Line 92, Column 18
- Expression: <StringExpr u'plone.leftcolumn'>
- Names:
{'container': <PloneSite at /saariselka>,
'context': <PloneSite at /saariselka>,
'default': <object object at 0x194520>,
'here': <PloneSite at /saariselka>,
'loop': {},
'nothing': None,
'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /Users/moo/saariselka/eggs/plone.app.portlets-1.2-py2.4.egg/plone/app/portlets/browser/templates/manage-contextual.pt object at 0x67e43b0>,)},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x73b59b8>,
'request': <HTTPRequest, URL=http://localhost:8080/saariselka/@@manage-portlets>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0x73b29f0>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.metaclass.SimpleViewClass from /Users/moo/saariselka/eggs/plone.app.portlets-1.2-py2.4.egg/plone/app/portlets/browser/templates/manage-contextual.pt object at 0x67e43b0>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x73b23d0>}
Module Products.Five.browser.providerexpression, line 37, in __call__
...
Module zope.tales.tales, line 696, in evaluate
- URL: index
- Line 18, Column 12
- Expression: <PathExpr standard:'view/addable_portlets'>
- Names:
{'container': <PloneSite at /saariselka>,
'context': <PloneSite at /saariselka>,
'default': <object object at 0x194520>,
'here': <PloneSite at /saariselka>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7941be8>,
'request': <HTTPRequest, URL=http://localhost:8080/saariselka/@@manage-portlets>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0x78be050>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer object at 0x789eb90>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x790a870>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 163, in _eval
Module Products.PageTemplates.Expressions, line 125, in render
Module plone.app.portlets.browser.editmanager, line 154, in addable_portlets
Module plone.app.portlets.browser.editmanager, line 149, in check_permission
Module OFS.Traversable, line 301, in restrictedTraverse
Module OFS.Traversable, line 284, in unrestrictedTraverse
- __traceback_info__: ([], 'collective.easytemplate.TemplatedPortlet')
NotFound: collective.easytemplate.TemplatedPortlet
This usually means that your site has an portlet assignment which code is not present anymore.
In this case you can see that portlet type “collective.easytemplate.TemplatedPortlet” is missing.
A” Check that you include the corresponding product (collective.easytemplate) in eggs= section in buildout.cfg
Module zope.tal.talinterpreter, line 408, in do_startTag
Module zope.tal.talinterpreter, line 485, in attrAction_tal
Module Products.PageTemplates.Expressions, line 230, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: edit_header
- Line 25, Column 14
- Expression: <PythonExpr (view.getHeaderDefiner().absolute_url())>
- Names:
{'container': <Frontpage at /saariselka/matkailijalle/saariselka-1>,
'context': <Frontpage at /saariselka/matkailijalle/saariselka-1>,
'default': <object object at 0x7fabf9cec1f0>,
'here': <Frontpage at /saariselka/matkailijalle/saariselka-1>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xe617d88>,
'request': <HTTPRequest, URL=http://localhost:9444/saariselka/matkailijalle/saariselka-1/@@edit_header>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0xe6105d0>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.metaclass.EditHeaderBehaviorView object at 0xe51ed10>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xe610c10>}
Module zope.tales.pythonexpr, line 59, in __call__
- __traceback_info__: (view.getHeaderDefiner().absolute_url())
Module <string>, line 0, in ?
Module OFS.Traversable, line 64, in absolute_url
Module OFS.Traversable, line 117, in getPhysicalPath
AttributeError: getPhysicalPath
Another possibility:
AttributeError: absolute_url
This usually means that you should have used context.aq_inner when you have used context. absolute_url() tries to get the path to the object, but object parent is set to view (context.aq_parent) instead of real container object (context.aq_inner.aq_parent).
警告
When setting a member attribute in BrowserView, the acquisition parent of objec changes to BrowserView instance. All member attributes receive ImplicitAcquisitionWrapper automatically.
We try to set BrowserView member attribute defining_context to be some context object.
(Pdb) self.defining_context = context (Pdb) context.aq_parent <PloneSite at /plone> (Pdb) self.defining_context.aq_parent <Products.Five.metaclass.HeaderAnimationHelper object at 0xadb5750> (Pdb) self.defining_context.aq_inner.aq_parent <Products.Five.metaclass.HeaderAnimationHelper object at 0xadb5750> (Pdb) self.defining_context.aq_parent.aq_parent <ATDocument at /plone/doc> (Pdb) self.defining_context.aq_parent.aq_parent.aq_inner <ATDocument at /plone/doc> (Pdb) self.defining_context.aq_parent.aq_parent.aq_parent <PloneSite at /plone>
To get the real object (as it was before set was called) you can create a helper getter:
def getDefiningContext(self):
"""
Un-fuse automatically injected view from the acquisition chain
@return: Real defining context object without bad acquistion
"""
if self.defining_context is not None:
return self.defining_context.aq_parent.aq_inner.aq_parent
return None
Example:
atapi.ImageField(
'memberimage',
# storage=atapi.AnnotationStorage(), # paster version
storage=atapi.AttributeStorage(), # results in "max recursion depth exceeded" error
widget=atapi.ImageWidget(
label=_(u"New Field"),
description=_(u"Field description"),
),
validators=('isNonEmptyFile'),
original_size=(600,600),
sizes={ 'mini' : (80,80),
'normal' : (200,200),
'big' : (300,300),
'maxi' : (500,500)},
),
This results in an exception when I try to access the object:
- __traceback_info__: ('memberimage', <TTMemberImage at tt_member_image.2010-01-23.8138248069>, {'field': <Field memberimage(image:rw)>})
Module Products.Archetypes.Storage, line 96, in get
Module Products.Archetypes.utils, line 808, in shasattr
Module Products.Archetypes.fieldproperty, line 101, in __get__
Module Products.Archetypes.Field, line 997, in get
Module Products.Archetypes.Field, line 709, in get
- __traceback_info__: ('memberimage', <TTMemberImage at tt_member_image.2010-01-23.8138248069>, {'field': <Field memberimage(image:rw)>})
RuntimeError: maximum recursion depth exceeded
Reason: Schema fields using AttributeStorage (usually images, files) cannot have ATFieldProperty in the class:
class Sample(base.ATCTContent):
# This does not work with AttributeStorage
memberimage = atapi.ATFieldProperty('memberimage')
To fix this simply remobe ATFieldProperty() declaration for the problematic field. You cannot access the field value anymore by calling object.memberimage but you need to call object.getMemberimage() instead.
The following exception may appear during Plone migration to the newer version:
* Dry run selected.
* Starting the migration from version: 3.1.4
* Attempting to upgrade from: 3.1.4
* Upgrade aborted
* Error type: zExceptions.BadRequest
* Error value: Invalid or duplicate property id
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/MigrationTool.py",
line 210, in upgrade newv, msgs = self._upgrade(newv)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/MigrationTool.py",
line 321, in _upgrade res = function(self.aq_parent)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/migrations/v3_1/final_three1x.py",
line 15, in three14_three15 loadMigrationProfile(portal,
'profile-Products.CMFPlone.migrations:3.1.3-3.1.4')
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/migrations/migration_util.py",
line 107, in loadMigrationProfile tool.runAllImportStepsFromProfile(profile,
purge_old=False)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Products.GenericSetup-1.4.5-py2.4.egg/Products/GenericSetup/tool.py",
line 390, in runAllImportStepsFromProfile
ignore_dependencies=ignore_dependencies)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Products.GenericSetup-1.4.5-py2.4.egg/Products/GenericSetup/tool.py",
line 1179, in _runImportStepsFromContext message =
self._doRunImportStep(step, context)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Products.GenericSetup-1.4.5-py2.4.egg/Products/GenericSetup/tool.py",
line 1090, in _doRunImportStep return handler(context)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/exportimport/propertiestool.py",
line 37, in importPloneProperties importer.body = body
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Products.GenericSetup-1.4.5-py2.4.egg/Products/GenericSetup/utils.py",
line 544, in _importBody self._importNode(dom.documentElement)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/exportimport/propertiestool.py",
line 103, in _importNode self._initObjects(node)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/exportimport/propertiestool.py",
line 154, in _initObjects importer.node = child
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Plone-3.3-py2.4.egg/Products/CMFPlone/exportimport/propertiestool.py",
line 77, in _importNode self._initProperties(node)
* File
"/usr/local/Plone3.2.3/buildout-cache/eggs/Products.GenericSetup-1.4.5-py2.4.egg/Products/GenericSetup/utils.py",
line 724, in _initProperties obj._setProperty(prop_id, val, prop_type)
* File
"/usr/local/Plone3.2.3/Zope-2.10.7-final-py2.4/lib/python/OFS/PropertyManager.py",
line 186, in _setProperty raise BadRequest, 'Invalid or duplicate property
id'
* End of upgrade path, migration has finished
* The upgrade path did NOT reach current version
* Migration has failed
* Dry run selected, transaction aborted
It is caused by a property (site setting) which already exists and migration tries to create it. The usual reason is that one has edited site settings in new Plone version before running the migration.
Try remove violating property ids from the site_properties manually in Zope.
Potential candidates to be removed:
Potential candidates which need to be added manually:
More info:
Traceback (innermost last):
- Module ZPublisher.Publish, line 202, in publish_module_standard
- Module Products.LinguaPlone.patches, line 66, in new_publish
- Module ZPublisher.Publish, line 150, in publish
- Module Zope2.App.startup, line 221, in zpublisher_exception_hook
- Module ZPublisher.Publish, line 119, in publish
- Module ZPublisher.mapply, line 88, in mapply
- Module ZPublisher.Publish, line 42, in call_object
- 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.CMFCore.FSPageTemplate, line 155, in pt_render
- Module Products.PageTemplates.PageTemplate, line 98, in pt_render
- Module zope.pagetemplate.pagetemplate, line 117, in pt_render Warning: Macro expansion failed Warning: zope.traversing.interfaces.TraversalError: (‘No traversable adapter found’,
This traceback is followed by long dump of template code internals.
Usual cause: Some add-on product fails to initialize.
Start Zope in foreground mode (bin/instance fg) to see which product fails.
Exception when starting Zope:
File "/Users/moo/twinapex/twinapex/parts/zope2/lib/python/ZConfig/datatypes.py", line 398, in get
t = self.search(name)
File "/Users/moo/twinapex/twinapex/parts/zope2/lib/python/ZConfig/datatypes.py", line 423, in search
package = __import__(n, g, g, component)
File "/Users/moo/twinapex/twinapex/parts/zope2/lib/python/Zope2/Startup/datatypes.py", line 20, in ?
from ZODB.config import ZODBDatabase
File "/Users/moo/twinapex/twinapex/eggs/ZODB3-3.8.2-py2.4-macosx-10.6-i386.egg/ZODB/__init__.py", line 20, in ?
from persistent import TimeStamp
File "/Users/moo/twinapex/twinapex/eggs/ZODB3-3.8.2-py2.4-macosx-10.6-i386.egg/persistent/__init__.py", line 19, in ?
from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY
ImportError: Inappropriate file type for dynamic loading
You probably have files lying over from wrong CPU architecture
How to solve problem
Traceback example:
...
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 140, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 196, in _exec
Module None, line 1, in content_edit
<FSControllerPythonScript at /xxx/content_edit used for /xxx/sisalto/lomapalvelut/portal_factory/HolidayService/aktiviteetit>
Line 1
Module Products.CMFCore.FSPythonScript, line 140, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 196, in _exec
Module None, line 9, in content_edit_impl
<FSPythonScript at /xxx/content_edit_impl used for /xxx/sisalto/lomapalvelut/portal_factory/HolidayService/aktiviteetit>
Line 9
Module Products.CMFPlone.FactoryTool, line 264, in doCreate
Module Products.ATContentTypes.lib.constraintypes, line 281, in invokeFactory
Module Products.CMFCore.PortalFolder, line 315, in invokeFactory
Module Products.CMFCore.TypesTool, line 716, in constructContent
Module Products.CMFCore.TypesTool, line 276, in constructInstance
Module Products.CMFCore.TypesTool, line 450, in _constructInstance
Module xxx.app.content.holidayservice, line 7, in addHolidayService
Module OFS.ObjectManager, line 315, in _setObject
Module Products.CMFCore.PortalFolder, line 333, in _checkId
Module OFS.ObjectManager, line 102, in checkValidId
BadRequest: The id "holidayservice.2010-03-18.4474765045" is invalid - it is already in use.
TODO: Not really sure why this happens.
Try portal_catalog rebuild as a fix.
Example traceback:
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 104, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 140, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 196, in _exec
Module None, line 11, in createObject
<FSControllerPythonScript at /xxx/createObject used for /xxx/sisalto/lomapalvelut>
Line 11
Exception: Type name not specified
This is TODO
This error is raised when you try to access view functions or objects for a view, which you call manually from the code.
Example traceback:
File "/home/moo/twinapex/parts/zope2/lib/python/zope/tales/expressions.py", line 124, in _eval
ob = self._traverser(ob, element, econtext)
File "/home/moo/twinapex/parts/zope2/lib/python/Products/PageTemplates/Expressions.py", line 105, in trustedBoboAwareZopeTraverse
request=request)
File "/home/moo/twinapex/parts/zope2/lib/python/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
File "/home/moo/twinapex/parts/zope2/lib/python/zope/traversing/adapters.py", line 44, in traverse
attr = getattr(subject, name, _marker)
File "/home/moo/twinapex/parts/zope2/lib/python/Shared/DC/Scripts/Bindings.py", line 184, in __getattr__
return guarded_getattr(self._wrapped, name, default)
File "/home/moo/twinapex/parts/zope2/lib/python/AccessControl/ImplPython.py", line 563, in validate
self._context)
File "/home/moo/twinapex/parts/zope2/lib/python/AccessControl/ImplPython.py", line 443, in validate
accessed, container, name, value, context)
File "/home/moo/twinapex/parts/zope2/lib/python/AccessControl/ImplPython.py", line 808, in raiseVerbose
raise Unauthorized(text)
Unauthorized: The object is marked as private. Access to 'showVideo' of (Products.Five.metaclass.SimpleViewClass from /home/moo/twinapex/src/mfabrik.app/mfabrik/app/browser/campaigntopview.pt object at 0x11003a0c) denied.
View acquisition chain is not properly set up and the security manager cannot traverse acquisition chain parents to properly determine permissions.
You need to use __of__() method to set-up the acquisition chain for the view:
def getHeadingView(self):
"""
Check if we have campaign view avaiable for this content and use it.
"""
view = queryMultiAdapter((self.context, self.request), name="mfabrik_heading")
view = view.__of__(self.context) # <---------- here
return view
Example:
Traceback (most recent call last):
File "/home/moo/isleofback/parts/zope2/lib/python/OFS/Application.py", line 709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/__init__.py", line 64, in ?
import Products.ATContentTypes.content
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/__init__.py", line 26, in ?
import Products.ATContentTypes.content.link
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/link.py", line 39, in ?
from Products.ATContentTypes.content.base import registerATCT
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/base.py", line 63, in ?
from Products.CMFPlone.PloneFolder import ReplaceableWrapper
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/__init__.py", line 215, in ?
from browser import ploneview
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/browser/ploneview.py", line 12, in ?
from Products.CMFPlone import utils
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/utils.py", line 6, in ?
from PIL import Image
ImportError: No module named PIL
Traceback (most recent call last):
File "/home/moo/isleofback/bin/idelauncher.py", line 140, in ?
execfile(ZOPE_RUN)
File "/home/moo/isleofback/bin/../parts/zope2/lib/python/Zope2/Startup/run.py", line 56, in ?
run()
File "/home/moo/isleofback/bin/../parts/zope2/lib/python/Zope2/Startup/run.py", line 21, in run
starter.prepare()
File "/home/moo/isleofback/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 102, in prepare
self.startZope()
File "/home/moo/isleofback/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 278, in startZope
Zope2.startup()
File "/home/moo/isleofback/parts/zope2/lib/python/Zope2/__init__.py", line 47, in startup
_startup()
File "/home/moo/isleofback/parts/zope2/lib/python/Zope2/App/startup.py", line 45, in startup
OFS.Application.import_products()
File "/home/moo/isleofback/parts/zope2/lib/python/OFS/Application.py", line 686, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
File "/home/moo/isleofback/parts/zope2/lib/python/OFS/Application.py", line 709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/__init__.py", line 64, in ?
import Products.ATContentTypes.content
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/__init__.py", line 26, in ?
import Products.ATContentTypes.content.link
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/link.py", line 39, in ?
from Products.ATContentTypes.content.base import registerATCT
File "/home/moo/isleofback/eggs/Products.ATContentTypes-1.3.4-py2.4.egg/Products/ATContentTypes/content/base.py", line 63, in ?
from Products.CMFPlone.PloneFolder import ReplaceableWrapper
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/__init__.py", line 215, in ?
from browser import ploneview
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/browser/ploneview.py", line 12, in ?
from Products.CMFPlone import utils
File "/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/utils.py", line 6, in ?
from PIL import Image
ImportError: No module named PIL
Python Imaging Library is not properly installed. The default PIL package does not work nicely as egg.
Remove all existing PIL eggs from buildout/eggs folder.
Install PIL for your development Python environment:
easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz
You’ll get a NotFound error when accessing view using view traverse notation, event though the view exist.
Example URL:
http://yoursite/@@myview
Example traceback:
Traceback (innermost last):
Module ZPublisher.Publish, line 110, in publish
Module ZPublisher.BaseRequest, line 506, in traverse
Module ZPublisher.HTTPResponse, line 686, in debugError
NotFound: <h2>Site Error</h2>
This is because there is an exception raised in your view’s __init__() method. Views are Zope multi-adapters. Exception in multi-adapter factory method causes ComponentLookUpError. Zope 2 publisher translates this to NotFound error.
How to fix
Example traceback:
Module zope.tales.tales, line 696, in evaluate
- URL: file:/home/moo/isleofback/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/skins/plone_templates/main_template.pt
- Line 39, Column 4
- Expression: <StringExpr u'plone.htmlhead'>
- Names:
{'container': <PloneSite at /isleofback>,
'context': <PloneSite at /isleofback>,
'default': <object object at 0xb75f2528>,
'here': <PloneSite at /isleofback>,
'loop': {},
'nothing': None,
'options': {'args': (<isleofback.app.browser.company.CompanyCreationForm object at 0xea5e80c>,)},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xea62dcc>,
'request': <HTTPRequest, URL=http://localhost:9666/isleofback/@@create_company>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0xea62bcc>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <UnauthorizedBinding: context>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xea62d2c>}
Module Products.Five.browser.providerexpression, line 25, in __call__
ContentProviderLookupError: plone.htmlhead
This is not a bug in Zope. It is caused by trying to render a Plone page frame in an context which has not acquisition chain properly set up. Plone main_template.pt tries to look up viewlet managers by acquistion traversing to parent objects. plone.htmlhead is the first viewlet manager to be looked up like this, and it will fail firstly.
Some possible causes
See
Example traceback:
Traceback (innermost last):
Module plone.postpublicationhook.hook, line 74, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 589, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 526, in installProduct
- __traceback_info__: ('mfabrik.app',)
Module Products.GenericSetup.tool, line 390, in runAllImportStepsFromProfile
- __traceback_info__: profile-mfabrik.app:default
Module Products.GenericSetup.tool, line 1179, in _runImportStepsFromContext
Module Products.GenericSetup.tool, line 1090, in _doRunImportStep
- __traceback_info__: portlets
Module plone.app.portlets.exportimport.portlets, line 707, in importPortlets
Module Products.GenericSetup.utils, line 543, in _importBody
ExpatError: portlets.xml: unbound prefix: line 15, column 1
Answer:
You have i18n:attributes="title; description" in your portlets.xml. Remove it or declare i18n namespace in XML.
The following traceback on instance start-up:
File "/Users/moo/twinapex/parts/zope2/lib/python/zope/configuration/config.py", line 1383, in toargs
args[str(name)] = field.fromUnicode(s)
File "/Users/moo/twinapex/parts/zope2/lib/python/zope/configuration/fields.py", line 141, in fromUnicode
raise schema.ValidationError(v)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/moo/twinapex/parts/instance/etc/site.zcml", line 14.2-14.55
ZopeXMLConfigurationError: File "/Users/moo/twinapex/parts/instance/etc/package-includes/009-gomobile.mobile-configure.zcml", line 1.0-1.59
ZopeXMLConfigurationError: File "/Users/moo/twinapex/src/gomobile.mobile/gomobile/mobile/configure.zcml", line 15.4-15.51
ZopeXMLConfigurationError: File "/Users/moo/twinapex/eggs/plone.postpublicationhook-1.1-py2.4.egg/plone/postpublicationhook/configure.zcml", line 5.4-8.10
ConfigurationError: ('Invalid value for', 'package', "ImportError: Couldn't import ZPublisherEventsBackport, No module named ZPublisherEventsBackport")
plone.postpublicationhook 1.1 depends on new package, ZPublisherEventsBackport, for Plone 3.3. You eed to include them both in your buildout. You need to include both eggs:
eggs =
ZPublisherEventsBackport
plone.postpublicationhook
The following traceback pops up when you try to start Zope:
2010-07-14 05:02:33 ERROR ZODB.Connection Couldn't load state for 0x00
Traceback (most recent call last):
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/Connection.py", line 811, in setstate
self._setstate(obj)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/Connection.py", line 870, in _setstate
self._reader.setGhostState(obj, p)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/serialize.py", line 604, in setGhostState
state = self.getState(pickle)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/serialize.py", line 597, in getState
return unpickler.load()
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/serialize.py", line 471, in _persistent_load
return self.load_oid(reference)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/serialize.py", line 537, in load_oid
return self._conn.get(oid)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/Connection.py", line 244, in get
p, serial = self._storage.load(oid, self._version)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/FileStorage/FileStorage.py", line 470, in load
pos = self._lookup_pos(oid)
File "/Users/moo/saariselka/eggs/ZODB3-3.8.4-py2.4-macosx-10.6-i386.egg/ZODB/FileStorage/FileStorage.py", line 462, in _lookup_pos
raise POSKeyError(oid)
POSKeyError: 0x01
Data.fs might have been damaged. You might be using blobs with Plone 3 and they don’t work perfectly. . . . or a bunch other issues which generally mean that your day is screwed.
See also
Symptoms: you do a HTTP request to a Plone site running OSX. Zope quits without a reason.
Reason: Infinite recursion is not properly handled by Python on OSX. This is because OSX C stack size is smaller than Python default stack size. The underlying Python interpreter dies before being able to raise stack size limit exception.
Workaround
Edit python-2.4/lib/python2.4/site.py
Put in to the first code line:
sys.setrecursionlimit(300)
This will force smaller Python stack not exceeding native OSX C stack. You might want to test other values and report back the findings.
More Information
Example traceback:
File "/home/moo/code/python/parts/opt/lib/python2.4/urllib.py", line 89, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "/home/moo/code/python/parts/opt/lib/python2.4/urllib.py", line 222, in retrieve
fp = self.open(url, data)
File "/home/moo/code/python/parts/opt/lib/python2.4/urllib.py", line 187, in open
return self.open_unknown(fullurl, data)
File "/home/moo/code/python/parts/opt/lib/python2.4/urllib.py", line 199, in open_unknown
raise IOError, ('url error', 'unknown url type', type)
IOError: [Errno url error] unknown url type: 'https'
Reason: Python and Python socket modules have not been compiled with SSL support.
Make sure that you have SSL development libraries installed (Ubuntu/Debian example)
sudo apt-get install libssl-dev
Make sure that Python is built with SSL support
./configure --with-package=_ssl
You can test Python after compilation:
moo@murskaamo:~/code/python$ source python-2.4/bin/activate
(python-2.4)moo@murskaamo:~/code/python$ python
Python 2.4.6 (#1, Jul 16 2010, 10:31:46)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
>>>
Also you might want try
easy_install pyopenssl
Traceback:
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
Module Products.CMFFormController.ControllerBase, line 231, in getNext
Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 104, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 140, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 196, in _exec
Module None, line 102, in order_email
- <FSControllerPythonScript at /MySite/order_email>
- Line 102
Module Products.SecureMailHost.SecureMailHost, line 246, in secureSend
Module Products.SecureMailHost.SecureMailHost, line 276, in _send
Module Products.SecureMailHost.mail, line 126, in send
Module smtplib, line 576, in login
Module smtplib, line 536, in encode_cram_md5
Module hmac, line 50, in __init__
TypeError: len() of unsized object
Cause: Your SMTP password has been set empty. Please reset your SMTP password in Mail control panel.
More information
This exception occurs when you try to customize TAL page template code using test() function. test() function has been dropped in Zope 3 page templates. You should no longer use test() function anywhere.
Solution: replace test() with common Python expression in your customized template.
For example the orignal:
tal:attributes="class python:test(here.Format() in ('text/structured', 'text/x-rst', ), 'stx' + kss_class, 'plain', + kss_class)"
would need to be written as:
tal:attributes=”class python:here.Format() in (‘text/structured’, ‘text/x-rst’, ) ‘stx’ + kss_class and ‘plain’ or kss_class”
You have traceback like:
File "/home/moo/sits/parts/zope2/lib/python/ZPublisher/Publish.py", line 119, in publish
request, bind=1)
File "/home/moo/sits/parts/zope2/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
File "/home/moo/sits/parts/zope2/lib/python/ZPublisher/Publish.py", line 42, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/home/moo/sits/parts/zope2/lib/python/Products/Five/browser/metaconfigure.py", line 417, in __call__
return self.index(self, *args, **kw)
File "/home/moo/sits/parts/zope2/lib/python/Shared/DC/Scripts/Bindings.py", line 313, in __call__
return self._bindAndExec(args, kw, None)
File "/home/moo/sits/parts/zope2/lib/python/Shared/DC/Scripts/Bindings.py", line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/moo/sits/parts/zope2/lib/python/Products/PageTemplates/PageTemplateFile.py", line 129, in _exec
return self.pt_render(extra_context=bound_names)
File "/home/moo/sits/parts/zope2/lib/python/Products/PageTemplates/PageTemplate.py", line 98, in pt_render
showtal=showtal)
File "/home/moo/sits/parts/zope2/lib/python/zope/pagetemplate/pagetemplate.py", line 117, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/home/moo/sits/parts/zope2/lib/python/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/home/moo/sits/parts/zope2/lib/python/zope/tal/talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/home/moo/sits/parts/zope2/lib/python/zope/tal/talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
handlers[opcode](self, args)
...
File "/home/moo/sits/parts/zope2/lib/python/zope/tal/talinterpreter.py", line 586, in do_setLocal_tal
self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/home/moo/sits/parts/zope2/lib/python/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/moo/sits/parts/zope2/lib/python/zope/tales/expressions.py", line 218, in __call__
return self._eval(econtext)
File "/home/moo/sits/parts/zope2/lib/python/Products/PageTemplates/Expressions.py", line 153, in _eval
ob = self._subexprs[-1](econtext)
File "/home/moo/sits/parts/zope2/lib/python/zope/tales/expressions.py", line 124, in _eval
ob = self._traverser(ob, element, econtext)
File "/home/moo/sits/parts/zope2/lib/python/Products/PageTemplates/Expressions.py", line 103, in trustedBoboAwareZopeTraverse
request=request)
File "/home/moo/sits/parts/zope2/lib/python/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
File "/home/moo/sits/parts/zope2/lib/python/zope/traversing/adapters.py", line 52, in traverse
raise TraversalError(subject, name)
From line Products/PageTemplates/Expressions.py you can see the error comes from TAL templates. TAL templates are trying to execute path based expressions.
If you can view this error through error_log the error_log traceback will contain information what expression causes the exception. However if this only happens with unit tests you can have something like:
def __call__(self, econtext):
if self._name == 'exists':
return self._exists(econtext)
print "Evaluating expression:" + self._s
return self._eval(econtext)
manually injected to zope.tales.expression module.