Ticket #13480 (closed Bug: fixed)

Opened 14 months ago

Last modified 13 months ago

Plone 4.3 does not start after Products.kupu is added to buildout

Reported by: danjacka Owned by:
Priority: major Milestone: 4.x
Component: Visual Editor Version: 4.3
Keywords: Cc:

Description

Steps to reproduce:

  1. Make a fresh buildout that extends  http://dist.plone.org/release/4.3rc1/versions.cfg
  2. ./bin/instance fg works fine.
  3. Stop the site, add Products.kupu to the eggs list, re-run buildout.
  4. ./bin/instance fg fails with the following traceback.
2013-03-12 16:02:49 INFO ZServer HTTP server started at Tue Mar 12 16:02:49 2013
	Hostname: 0.0.0.0
	Port: 8080
2013-03-12 16:02:52 WARNING ZODB.blob (4933) Blob dir /home/danj/opt/plone/4.3kupu/var/blobstorage/ has insecure mode setting
Traceback (most recent call last):
  File "/home/danj/opt/plone/4.3kupu/parts/instance/bin/interpreter", line 271, in <module>
    execfile(__file__)
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", line 262, in startZope
    Zope2.startup()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", line 118, in startup
    load_zcml()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", line 52, in load_zcml
    load_site()
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/zcml.py", line 46, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 649, in file
    include(context, name, package)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/home/danj/.buildout/eggs/Zope2-2.13.19-py2.7.egg/OFS/metaconfigure.py", line 46, in loadProducts
    xmlconfig.include(_context, zcml, package=product)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 705, in finish
    args = toargs(context, *self.argdata)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 1397, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/fields.py", line 137, in fromUnicode
    value = self.context.resolve(name)
  File "/home/danj/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 179, in resolve
    mod = __import__(mname, *_import_chickens)
  File "/home/danj/.buildout/eggs/wicked-1.1.10-py2.7.egg/wicked/at/field.py", line 27, in <module>
    class WikiField(atapi.TextField):
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/danj/opt/plone/4.3kupu/parts/instance/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/home/danj/.buildout/eggs/Products.CMFPlone-4.3rc1-py2.7.egg/Products/CMFPlone/configure.zcml", line 52.4-52.65
    ZopeXMLConfigurationError: File "/home/danj/.buildout/eggs/wicked-1.1.10-py2.7.egg/wicked/plone/selective-atct.zcml", line 7.2-7.33
    ZopeXMLConfigurationError: File "/home/danj/.buildout/eggs/wicked-1.1.10-py2.7.egg/wicked/at/configure.zcml", line 14.3-16.8
    AttributeError: 'module' object has no attribute 'TextField'

Change History

comment:1 follow-up: ↓ 3 Changed 14 months ago by kleist

  • Priority changed from minor to major
  • Status changed from new to confirmed
  • Component changed from Unknown to Visual Editor

Setting Component to "Visual Editor", although I'm not sure that we officially support Kupu anymore.

comment:2 Changed 14 months ago by danjacka

More debug info: using ./bin/instance debug and running this code:

import sys
from pprint import pprint
pprint(dir(sys.modules['Products.Archetypes.public']))

with Products.kupu in the build produces:

['BaseContent',
 'BaseContentMixin',
 'BaseFolder',
 'BaseFolderMixin',
 'BaseObject',
 '__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 'listTypes',
 'process_types',
 'registerClasses',
 'registerType']

but without Products.kupu in the build produces a much longer list:

['ATDateTimeFieldProperty',
 'ATFieldProperty',
 'ATHistoryAwareMixin',
 'ATReferenceFieldProperty',
 'AT_ANN_STORAGE',
 'AT_FIELD_MD',
 'AT_GENERATE_METHOD',
 'AT_MD_STORAGE',
 'AT_REF',
 'AnnotationStorage',
 'AttributeStorage',
 'AttributeValidator',
 'BaseBTreeFolder',
 'BaseBTreeFolderSchema',
 'BaseContent',
 'BaseContentMixin',
 'BaseFolder',
 'BaseFolderMixin',
 'BaseFolderSchema',
 'BaseObject',
 'BaseSQLStorage',
 'BaseSchema',
 'BaseUnit',
 'BasicSchema',
 'BooleanField',
 'BooleanWidget',
 'CMFObjectField',
 'CalendarWidget',
 'CompositeSchema',
 'ComputedField',
 'ComputedWidget',
 'DateTimeField',
 'DecimalWidget',
 'DisplayList',
 'EpozWidget',
 'ExtensibleMetadata',
 'ExtensibleMetadataSchema',
 'FacadeMetadataSchema',
 'Field',
 'FileField',
 'FileWidget',
 'FixedPointField',
 'FloatField',
 'GadflySQLStorage',
 'IdWidget',
 'ImageField',
 'ImageWidget',
 'InAndOutWidget',
 'IntDisplayList',
 'IntegerField',
 'IntegerWidget',
 'KeywordWidget',
 'LabelWidget',
 'LanguageWidget',
 'LinesField',
 'LinesWidget',
 'ManagedSchema',
 'MetadataAnnotationStorage',
 'MetadataSchema',
 'MetadataStorage',
 'MinimalSchema',
 'MultiSelectionWidget',
 'MySQLSQLStorage',
 'ObjectField',
 'ObjectManagedStorage',
 'OrderedBaseFolder',
 'OrderedBaseFolderSchema',
 'PasswordWidget',
 'PicklistWidget',
 'PostgreSQLStorage',
 'PrimaryFieldMarshaller',
 'RFC822Marshaller',
 'ReadOnlyStorage',
 'ReferenceField',
 'ReferenceWidget',
 'RequiredIdWidget',
 'RichWidget',
 'SQLServerStorage',
 'Schema',
 'SelectionWidget',
 'StringField',
 'StringWidget',
 'TemplateMixin',
 'TemplateMixinSchema',
 'TextAreaWidget',
 'TextField',
 'VariableSchemaSupport',
 'VisualWidget',
 'Vocabulary',
 '__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 'getAnnotation',
 'listTypes',
 'log',
 'log_exc',
 'process_types',
 'registerClasses',
 'registerType']

comment:3 in reply to: ↑ 1 Changed 14 months ago by danjacka

Replying to kleist:

... I'm not sure that we officially support Kupu anymore.

I'm not sure either, though I note that  http://plone.org/products/plone/releases/4.3 states that "Those wishing to use kupu must explicity require Products.kupu in their buildouts".

comment:4 follow-up: ↓ 5 Changed 14 months ago by esteele

The issue seems to be in  https://github.com/plone/wicked/blob/master/wicked/at/field.py#L13. Only the first few imports in atapi get pulled in that way. Changing the import to be "from Products.Archetypes import atapi" makes everything work as expected.

comment:5 in reply to: ↑ 4 Changed 14 months ago by danjacka

Replying to esteele:

Only the first few imports in atapi get pulled in that way.

Right, but only if you have Products.kupu in the buildout. Changing the import in wicked fixes the immediate problem (i.e. your site starts), but some things will break down the line e.g. schema extensions based on  https://pypi.python.org/pypi/archetypes.schemaextender#layer-aware-example, which contains from Products.Archetypes import public as atapi, atapi.DateTimeField, etc.

Last edited 14 months ago by danjacka (previous) (diff)

comment:6 Changed 14 months ago by danjacka

I put a breakpoint in Products.Archetypes.public and compared the call stacks of Plone 4.2 versus Plone 4.3+kupu at its first import.

In 4.3+kupu, the first import of Products.Archetypes.public comes from Products.kupu.plone.plonedrawers and that traces back to the following in plone.app.upgrade:

try:
    import Products.kupu
except ImportError:
     import kupu_bbb
     alias_module('Products.kupu.plone.plonelibrarytool', kupu_bbb)

This is new in 4.3. With Products.kupu not in the build it's fine, but when I add Products.kupu the Products.Archetypes.public import happens too early, before Archetypes is fully initialised (I think).

I've changed the code to use pkg_resources instead. Pull request here:  https://github.com/plone/plone.app.upgrade/pull/6

comment:7 Changed 13 months ago by danjacka

  • Status changed from confirmed to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.