plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
255 stars 191 forks source link

Typo in 4.3.19 causes plone site to crash #2964

Closed avolkov closed 4 years ago

avolkov commented 5 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

On upgrade the site crashes displaying tal error. It seems to be a syntax error issue, I will attach

What I did:

Upgrade plone 4.1 to plone 4.3

What I expect to happen:

Expect existing site running

What actually happened:

Crash with the following message

PTRuntimeError('Page Template main_template has errors:
 [\'Compilation failed\', \'zope.tal.taldefs.TALError: 
Python expression error:\\nEOL while scanning string literal (PythonExpr, line 1) 
in expression u"python:request.RESPONSE.setHeader(\\\'X-XSS-Protection\\\', \\\'1", at line 6, column 1\']',)
(Also, the following error occurred while attempting to render the standard error message, 
please see the event log for full details:
Page Template main_template has errors: 
['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:
EOL while scanning string literal (PythonExpr, line 1) in expression 
u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1'])

What version of Plone/ Addons I am using:

Plone 4.3.19 (4321)
CMF 2.2.10
Zope 2.13.29
Python 2.7.14 (default, May 17 2018, 16:02:42) [GCC 7.3.0]
PIL 3.3.3 (Pillow)

The bug in this package in particular is in Producs.CMFPlone-4.3.19

The proble is in skins/plone_templates/main_template.pt in branch 4.x on line 25 it seems that one of the semicolons is not properly escape. I'll add a pull request that fixes this.

avolkov commented 5 years ago

Here is the full traceback of the issue

s2019-10-24 14:59:16 ERROR Zope.SiteErrorLog 1571943556.10.501197343689 http://localhost:8080/poa/@@editing-controlpanel
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module zope.formlib.form, line 873, in __call__
  Module zope.formlib.form, line 863, in render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
   - Warning: Macro expansion failed
   - Warning: <class 'zope.pagetemplate.pagetemplate.PTRuntimeError'>: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 867, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/home/alex/mag/poa_plone41/eggs/Products.CMFPlone-4.3.19-py2.7.egg/Products/CMFPlone/skins/plone_prefs/prefs_main_template.pt
   - Line 2, Column 2
   - Expression: <PathExpr standard:u'context/main_template/macros/master'>
   - Names:
      {'args': (),
       'container': <PloneSite at /poa>,
       'context': <PloneSite at /poa>,
       'default': <object object at 0x7f99f0248570>,
       'here': <PloneSite at /poa>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f99e0bb7cb0>,
       'request': <HTTPRequest, URL=http://localhost:8080/poa/@@editing-controlpanel>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f99e5197690>,
       'traverse_subpath': [],
       'user': <PloneUser 'portaladmin'>,
       'view': <Products.Five.metaclass.EditingControlPanel object at 0x7f99e0b19dd0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f99e0b4b6d0>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 74, in boboAwareZopeTraverse
  Module OFS.Traversable, line 317, in restrictedTraverse
  Module OFS.Traversable, line 249, in unrestrictedTraverse
   - __traceback_info__: ([], 'macros')
  Module Products.PageTemplates.PageTemplate, line 59, in macros
  Module Products.CMFCore.FSPageTemplate, line 165, in pt_macros
  Module Products.PageTemplates.PageTemplate, line 68, in pt_macros
   - Warning: Compilation failed
   - Warning: zope.tal.taldefs.TALError: Python expression error:
EOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader('X-XSS-Protection', '1", at line 6, column 1
PTRuntimeError: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
2019-10-24 14:59:16 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
    v = s(**kwargs)
  File "/home/alex/mag/poa_plone41/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPythonScript.py", line 127, in __call__
    return Script.__call__(self, *args, **kw)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/alex/mag/poa_plone41/eggs/Products.PythonScripts-2.13.2-py2.7.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
    result = f(*args, **kw)
  File "Script (Python)", line 35, in standard_error_message
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/alex/mag/poa_plone41/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 237, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "/home/alex/mag/poa_plone41/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 177, in pt_render
    self, source, extra_context
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 87, in pt_render
    showtal=showtal)
  File "/home/alex/mag/poa_plone41/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/home/alex/mag/poa_plone41/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 240, in __call__
    interpreter()
  File "/home/alex/mag/poa_plone41/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/alex/mag/poa_plone41/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/alex/mag/poa_plone41/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 867, in do_useMacro
    macro = self.engine.evaluateMacro(macroExpr)
  File "/home/alex/mag/poa_plone41/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/alex/mag/poa_plone41/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/Expressions.py", line 147, in _eval
    ob = self._subexprs[-1](econtext)
  File "/home/alex/mag/poa_plone41/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/expressions.py", line 124, in _eval
    ob = self._traverser(ob, element, econtext)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/Expressions.py", line 74, in boboAwareZopeTraverse
    object = object.restrictedTraverse(name)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/OFS/Traversable.py", line 317, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/OFS/Traversable.py", line 249, in unrestrictedTraverse
    if getattr(aq_base(obj), name, _marker) is not _marker:
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 59, in macros
    return self.pt_macros()
  File "/home/alex/mag/poa_plone41/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 165, in pt_macros
    return FSPageTemplate.inheritedAttribute('pt_macros')(self)
  File "/home/alex/mag/poa_plone41/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 68, in pt_macros
    self.id, self._v_errors
PTRuntimeError: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
avolkov commented 5 years ago

Here's a less-badly formatted browser error response

PTRuntimeError('Page Template main_template has errors: [\'Compilation failed\', \'zope.tal.taldefs.TALError: Python expression error:\\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\\\'X-XSS-Protection\\\', \\\'1", at line 6, column 1\']',) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error: EOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1'])

mauritsvanrees commented 5 years ago

I cannot reproduce this. I tried this simple buildout.cfg:

[buildout]
extends = https://dist.plone.org/release/4.3.19/versions.cfg
parts = instance

[instance]
recipe = plone.recipe.zope2instance
eggs =
    Plone
user = admin:admin

So some questions:

avolkov commented 5 years ago

I forgot to add a bit of context, I'm migrating Plone 3 site to Plone 4. I'm using PloneTheme and ATContent types for custom products. The products haven't been yet migrated.

Yes this happens only on a migrated site

2019-10-30 17:12:51 ERROR Zope.SiteErrorLog 1572469971.560.612593528969 http://localhost:8080/poa/@@editing-controlpanel
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module zope.formlib.form, line 873, in __call__
  Module zope.formlib.form, line 863, in render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
   - Warning: Macro expansion failed
   - Warning: <class 'zope.pagetemplate.pagetemplate.PTRuntimeError'>: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 867, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/home/alex/poa/eggs/Products.CMFPlone-4.3.19-py2.7.egg/Products/CMFPlone/skins/plone_prefs/prefs_main_template.pt
   - Line 2, Column 2
   - Expression: <PathExpr standard:u'context/main_template/macros/master'>
   - Names:
      {'args': (),
       'container': <PloneSite at /poa>,
       'context': <PloneSite at /poa>,
       'default': <object object at 0x7fd96f31e570>,
       'here': <PloneSite at /poa>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7fd9616c2940>,
       'request': <HTTPRequest, URL=http://localhost:8080/poa/@@editing-controlpanel>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7fd96410f110>,
       'traverse_subpath': [],
       'user': <PloneUser 'portaladmin'>,
       'view': <Products.Five.metaclass.EditingControlPanel object at 0x7fd9616b2050>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7fd9616b5650>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 74, in boboAwareZopeTraverse
  Module OFS.Traversable, line 317, in restrictedTraverse
  Module OFS.Traversable, line 249, in unrestrictedTraverse
   - __traceback_info__: ([], 'macros')
  Module Products.PageTemplates.PageTemplate, line 59, in macros
  Module Products.CMFCore.FSPageTemplate, line 165, in pt_macros
  Module Products.PageTemplates.PageTemplate, line 68, in pt_macros
   - Warning: Compilation failed
   - Warning: zope.tal.taldefs.TALError: Python expression error:
EOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader('X-XSS-Protection', '1", at line 6, column 1
PTRuntimeError: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
2019-10-30 17:12:51 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
    v = s(**kwargs)
  File "/home/alex/poa/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPythonScript.py", line 127, in __call__
    return Script.__call__(self, *args, **kw)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/alex/poa/eggs/Products.PythonScripts-2.13.2-py2.7.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
    result = f(*args, **kw)
  File "Script (Python)", line 35, in standard_error_message
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/alex/poa/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 237, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "/home/alex/poa/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 177, in pt_render
    self, source, extra_context
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 87, in pt_render
    showtal=showtal)
  File "/home/alex/poa/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/home/alex/poa/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 240, in __call__
    interpreter()
  File "/home/alex/poa/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/alex/poa/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/alex/poa/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 867, in do_useMacro
    macro = self.engine.evaluateMacro(macroExpr)
  File "/home/alex/poa/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/alex/poa/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/Expressions.py", line 147, in _eval
    ob = self._subexprs[-1](econtext)
  File "/home/alex/poa/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/expressions.py", line 124, in _eval
    ob = self._traverser(ob, element, econtext)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/Expressions.py", line 74, in boboAwareZopeTraverse
    object = object.restrictedTraverse(name)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/OFS/Traversable.py", line 317, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/OFS/Traversable.py", line 249, in unrestrictedTraverse
    if getattr(aq_base(obj), name, _marker) is not _marker:
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 59, in macros
    return self.pt_macros()
  File "/home/alex/poa/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 165, in pt_macros
    return FSPageTemplate.inheritedAttribute('pt_macros')(self)
  File "/home/alex/poa/eggs/Zope2-2.13.29-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 68, in pt_macros
    self.id, self._v_errors
PTRuntimeError: Page Template main_template has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Python expression error:\nEOL while scanning string literal (PythonExpr, line 1) in expression u"python:request.RESPONSE.setHeader(\'X-XSS-Protection\', \'1", at line 6, column 1']
[buildout]
extends = https://dist.plone.org/release/4.3.19/versions.cfg
parts = instance

develop =
    src/Products.POAContentTypes
    src/Products.POATheme

[versions]
zc.buildout = 2.13.2
setuptools = 38.7.0

[instance]
recipe = plone.recipe.zope2instance
eggs =
    Plone
user = admin:admin

However I'm getting the following error.

2019-10-30 17:18:30 ERROR Zope.SiteErrorLog 1572470310.520.271220319161 http://localhost:8080/poa
Traceback (innermost last):
  Module ZPublisher.Publish, line 127, in publish
  Module ZPublisher.BaseRequest, line 444, in traverse
  Module ZPublisher.BeforeTraverse, line 97, in __call__
  Module Products.CMFCore.PortalObject, line 75, in __before_publishing_traverse__
  Module zope.event, line 31, in notify
  Module zope.component.event, line 24, in dispatch
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module zope.component.event, line 32, in objectEventNotify
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module plone.app.theming.plugins.hooks, line 30, in onRequest
  Module plone.app.theming.utils, line 429, in isThemeEnabled
  Module zope.component._api, line 172, in queryUtility
  Module zope.component.registry, line 163, in queryUtility
  Module ZODB.Connection, line 860, in setstate
  Module ZODB.Connection, line 914, in _setstate
  Module ZODB.serialize, line 613, in setGhostState
  Module zope.component.persistentregistry, line 40, in __setstate__
  Module zope.interface.adapter, line 91, in _createLookup
  Module zope.interface.adapter, line 439, in __init__
  Module zope.interface.adapter, line 476, in init_extendors
  Module zope.interface.adapter, line 480, in add_extendor
AttributeError: type object 'IIntIds' has no attribute '__iro__'
2019-10-30 17:18:30 ERROR ZODB.Connection Couldn't load state for 0x04272b
Traceback (most recent call last):
  File "/home/alex/poa/eggs/ZODB3-3.10.7-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 860, in setstate
    self._setstate(obj)
  File "/home/alex/poa/eggs/ZODB3-3.10.7-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 914, in _setstate
    self._reader.setGhostState(obj, p)
  File "/home/alex/poa/eggs/ZODB3-3.10.7-py2.7-linux-x86_64.egg/ZODB/serialize.py", line 613, in setGhostState
    obj.__setstate__(state)
  File "/home/alex/poa/eggs/zope.component-3.9.5-py2.7.egg/zope/component/persistentregistry.py", line 40, in __setstate__
    self._createLookup()
  File "/home/alex/poa/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 91, in _createLookup
    self._v_lookup = self.LookupClass(self)
  File "/home/alex/poa/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 439, in __init__
    self.init_extendors()
  File "/home/alex/poa/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 476, in init_extendors
    self.add_extendor(p)
  File "/home/alex/poa/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 480, in add_extendor
    for i in provided.__iro__:
AttributeError: type object 'IIntIds' has no attribute '__iro__'

No I don't have it installed. When I add this dependency, in eggs I'm getting the following error.

zip_safe flag not set; analyzing archive contents...
Got cssselect 1.1.0.
Version and requirements information containing plone.protect:
  [versions] constraint on plone.protect: 2.0.3
  Requirement of plone4.csrffixes==1.1.1: plone.protect>=3.0.19
  Requirement of Products.CMFPlone: plone.protect>1.0
While:
  Installing instance.
Error: The requirement ('plone.protect>=3.0.19') is not allowed by your [versions] constraint (2.0.3)

I have the following overrides in versions to get setup working with my virtualenv setup

[versions]
zc.buildout = 2.13.2
setuptools = 38.7.0

Also I have the following eggs specified:

eggs =
    Plone
    Pillow
    icalendar
    python-dateutil
    Products.POAContentTypes
    Products.POATheme
    plonetheme.classic
    plone.app.contenttypes [atrefs]

I have the following viewlets defined


class LogoViewlet(ViewletBase):
    render = ViewPageTemplateFile('templates/logo.pt')

    def update(self):
        portal_state = getMultiAdapter(
            (self.context, self.request), name=u'plone_portal_state')

        self.navigation_root_url = portal_state.navigation_root_url()

class IThemeSpecific(IDefaultPloneLayer):
    """
    Marker interface that defines a Zope 3 skin layer bound to a Skin
    Selection in portal_skins.
    """

class FooterViewlet(ViewletBase):
    render = ViewPageTemplateFile('templates/footer.pt')

    def update(self):
        portal_state = getMultiAdapter(
            (self.context, self.request), name=u'plone_portal_state')
        self.portal_title = portal_state.portal_title
        self.site_url = portal_state.portal_url()
mauritsvanrees commented 5 years ago

Do you have this only on your migrated site? Or also when you create a new site?

This error doesn't occur. I suspect because new site uses Plone 4 theme and the old site still uses Plone 3 theme.

Bingo! Now I can reproduce it:

So:

Workarounds available for you:

mauritsvanrees commented 5 years ago

See also my comment.