問題:ユーザーがエラーページに移動するたびに、「ページが見つかりません」というメッセージをploneに表示する代わりに、このzopeエラーメッセージが代わりに表示されます。
NotFound(' <h2>Site Error</h2>\n <p>An error was encountered while publishing this resource.\n </p>\n <p><strong>Resource not found</strong></p>\n\n Sorry, the requested resource does not exist.<p>Check the URL and try again.</p><p><b>Resource:</b> http://www.caseware.com/ddddd</p>\n <hr noshade="noshade"/>\n\n <p>Troubleshooting Suggestions</p>\n\n <ul>\n <li>The URL may be incorrect.</li>\n <li>The parameters passed to this resource may be incorrect.</li>\n <li>A resource that this resource relies on may be\n encountering an error.</li>\n </ul>\n\n <p>For more detailed information about the error, please\n refer to the error log.\n </p>\n\n <p>If the error persists please contact the site maintainer.\n Thank you for your patience.\n </p>',) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: )
同時に、エラーが発生したインスタンスのログファイルには、次のスタックトレースが表示されます。
2012-10-03T13:12:06 ERROR root Exception while rendering an error message
Traceback (most recent call last):
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
v = s(**kwargs)
File "/home/alex/projects/production/plone4_dev/eggs/Products.CMFCore-2.2.5-py2.6.egg/Products/CMFCore/FSPythonScript.py", line 130, in __call__
return Script.__call__(self, *args, **kw)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
return self._bindAndExec(args, kw, None)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/alex/projects/production/plone4_dev/eggs/Products.PythonScripts-2.13.0-py2.6.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
result = f(*args, **kw)
File "Script (Python)", line 34, in standard_error_message
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
return self._bindAndExec(args, kw, None)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/alex/projects/production/plone4_dev/eggs/Products.CMFCore-2.2.5-py2.6.egg/Products/CMFCore/FSPageTemplate.py", line 240, in _exec
result = self.pt_render(extra_context=bound_names)
File "/home/alex/projects/production/plone4_dev/eggs/Products.CMFCore-2.2.5-py2.6.egg/Products/CMFCore/FSPageTemplate.py", line 180, in pt_render
self, source, extra_context
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/PageTemplates/PageTemplate.py", line 79, in pt_render
showtal=showtal)
File "/home/alex/projects/production/plone4_dev/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 888, in do_useMacro
self.interpret(macro)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
self.do_optTag(stuff)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
return self.no_tag(start, program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/PageTemplates/Expressions.py", line 218, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/alex/projects/production/plone4_dev/eggs/zope.contentprovider-3.7.2-py2.6.egg/zope/contentprovider/tales.py", line 80, in __call__
return provider.render()
File "/home/alex/projects/production/plone4_dev/eggs/plone.app.viewletmanager-2.0.2-py2.6.egg/plone/app/viewletmanager/manager.py", line 85, in render
return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
File "/home/alex/projects/production/plone4_dev/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/simpleviewclass.py", line 44, in __call__
return self.index(*args, **kw)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/Five/browser/pagetemplatefile.py", line 125, in __call__
return self.im_func(im_self, *args, **kw)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/Five/browser/pagetemplatefile.py", line 59, in __call__
sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/home/alex/projects/production/plone4_dev/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
self.do_optTag(stuff)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
return self.no_tag(start, program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/PageTemplates/Expressions.py", line 218, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/alex/projects/production/plone4_dev/eggs/zope.contentprovider-3.7.2-py2.6.egg/zope/contentprovider/tales.py", line 80, in __call__
return provider.render()
File "/home/alex/projects/production/plone4_dev/eggs/zope.viewlet-3.7.2-py2.6.egg/zope/viewlet/manager.py", line 124, in render
return self.template(viewlets=self.viewlets)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/Five/browser/pagetemplatefile.py", line 125, in __call__
return self.im_func(im_self, *args, **kw)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/Five/browser/pagetemplatefile.py", line 59, in __call__
sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/home/alex/projects/production/plone4_dev/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 819, in do_loop_tal
iterator = self.engine.setRepeat(name, expr)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 682, in setRepeat
expr = self.evaluate(expr)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/alex/projects/production/plone4_dev/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
return self._eval(econtext)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/PageTemplates/Expressions.py", line 155, in _eval
return render(ob, econtext.vars)
File "/home/alex/projects/production/plone4_dev/eggs/Zope2-2.13.12-py2.6.egg/Products/PageTemplates/Expressions.py", line 117, in render
ob = ob()
File "/home/alex/projects/production/plone4_dev/eggs/Products.ResourceRegistries-2.0.6-py2.6.egg/Products/ResourceRegistries/browser/scripts.py", line 27, in scripts
content = registry.getInlineResource(script.getId(), context)
File "/home/alex/projects/production/plone4_dev/eggs/Products.ResourceRegistries-2.0.6-py2.6.egg/Products/ResourceRegistries/tools/BaseRegistry.py", line 856, in getInlineResource
output = self.getResourceContent(item, context)
File "/home/alex/projects/production/plone4_dev/eggs/Products.ResourceRegistries-2.0.6-py2.6.egg/Products/ResourceRegistries/tools/JSRegistry.py", line 246, in getResourceContent
output = BaseRegistryTool.getResourceContent(self, item, context, original)
File "/home/alex/projects/production/plone4_dev/eggs/Products.ResourceRegistries-2.0.6-py2.6.egg/Products/ResourceRegistries/tools/BaseRegistry.py", line 593, in getResourceContent
self._restoreCachingHeaders(original_headers, if_modified)
File "/home/alex/projects/production/plone4_dev/eggs/Products.ResourceRegistries-2.0.6-py2.6.egg/Products/ResourceRegistries/tools/BaseRegistry.py", line 661, in _restoreCachingHeaders
assert int(self.REQUEST.RESPONSE.getStatus()) / 100 == 2
AssertionError
私はここ数日これを理解しようとしていますが、主な問題は、このエラーは本番構成でのみ発生し、開発環境では再現できないことです。
この問題は、サイトがジアゾを使用した新しいデザインでアップグレードされたときに始まりました。また、Centos5.6からCentos6に移動されましたが、それほど重要ではないと思います。それ以外の場合、bulidout.cfgは変更されませんでした。
ローカル開発マシンでエラーを再現しようとすると、インスタンスがdebug-mode = offで実行されている場合にのみトリガーでき、プロセスはバックグラウンドで実行されている必要があります。フォアグラウンドで実行されている場合は常にエラーは発生しません。トリガーされず、正しい404エラーメッセージが表示されます。基本的に、開発環境ではすべてが正常に実行されますが、コードが本番環境に移動されるとすぐに、404ページが壊れます。
環境情報:
Plone 4.1.4
Zope 2.13.12
Python 2.6.7 (r267:88850, Dec 13 2011, 17:15:07) [GCC 4.6.2]