plone / Products.CMFPlone

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

Compiling resources fails, if persistent utilities are present in site #2137

Closed tomgross closed 2 years ago

tomgross commented 7 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

Compile plone-logged-in bundle with newer version of mockup

$ bin/plone-compile-resources -s Plone -b plone-logged-in

What I expect to happen:

Bundle plone-logged-in compiles with newer version of mockup

What actually happened:

Command fails with this traceback:

2017-09-06 10:14:08 ERROR ZODB.Connection Couldn't load state for five.localsitemanager.registry.PersistentComponents 0x2a
Traceback (most recent call last):
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/Connection.py", line 800, in setstate
    self._reader.setGhostState(obj, p)
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/serialize.py", line 622, in setGhostState
    state = self.getState(pickle)
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/serialize.py", line 615, in getState
    return unpickler.load()
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/serialize.py", line 472, in find_global
    return factory(conn, modulename, name)
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/DB.py", line 862, in classFactory
    return find_global(modulename, globalname)
  File "/home/vagrant/Eggs/ZODB-5.2.4-py2.7.egg/ZODB/broken.py", line 204, in find_global
    __import__(modulename)
  File "/home/vagrant/www.fhnw.ch/src/collective.solr/src/collective/solr/search.py", line 5, in <module>
    from collective.solr.interfaces import ISearch
  File "/home/vagrant/www.fhnw.ch/src/collective.solr/src/collective/solr/interfaces.py", line 16, in <module>
    class ISolrSchema(Interface):
  File "/home/vagrant/www.fhnw.ch/src/collective.solr/src/collective/solr/interfaces.py", line 25, in ISolrSchema
    default=False,
  File "/home/vagrant/Eggs/zope.schema-4.4.2-py2.7.egg/zope/schema/_bootstrapfields.py", line 152, in __init__
    self.title = title
  File "/home/vagrant/Eggs/zope.schema-4.4.2-py2.7.egg/zope/schema/fieldproperty.py", line 82, in __set__
    event.notify(FieldUpdatedEvent(inst, field, oldvalue, value))
  File "/home/vagrant/Eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/vagrant/Eggs/zope.interface-4.4.0-py2.7-linux-x86_64.egg/zope/interface/registry.py", line 442, in subscribers
    return self.adapters.subscribers(objects, provided)
AttributeError: 'RequestContainer' object has no attribute 'adapters'
Traceback (most recent call last):
  File "/home/vagrant/www.fhnw.ch/parts/instance1v/bin/interpreter", line 351, in <module>
    exec(_val)
  File "<string>", line 1, in <module>
  File "/home/vagrant/Eggs/Products.CMFPlone-5.1b4-py2.7.egg/Products/CMFPlone/_scripts/_generate_gruntfile.py", line 60, in <module>
    applyBrowserLayers(portal)
  File "/home/vagrant/Eggs/Products.CMFPlone-5.1b4-py2.7.egg/Products/CMFPlone/_scripts/_generate_gruntfile.py", line 36, in applyBrowserLayers
    sm = getSiteManager(site)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hookable.py", line 33, in __call__
    return self.__implementation(*args, **kw)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hooks.py", line 107, in getSiteManager
    context, zope.component.getGlobalSiteManager())
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hookable.py", line 33, in __call__
    return self.__implementation(*args, **kw)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hooks.py", line 115, in adapter_hook
    return siteinfo.adapter_hook(interface, object, name, default)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hooks.py", line 38, in __get__
    return self.func(inst)
  File "/home/vagrant/Eggs/zope.component-3.12.1-py2.7.egg/zope/component/hooks.py", line 45, in adapter_hook
    adapter_hook = self.sm.adapters.adapter_hook
AttributeError: 'RequestContainer' object has no attribute 'adapters'
Traceback (most recent call last):
  File "bin/plone-compile-resources", line 341, in <module>
    sys.exit(Products.CMFPlone._scripts.compile_resources.main())
  File "/home/vagrant/Eggs/Products.CMFPlone-5.1b4-py2.7.egg/Products/CMFPlone/_scripts/compile_resources.py", line 154, in main
    args.compile_dir
  File "/home/vagrant/Eggs/Products.CMFPlone-5.1b4-py2.7.egg/Products/CMFPlone/_scripts/compile_resources.py", line 56, in generate_gruntfile
    subprocess.check_call(cmd, env=os.environ)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bin/instance', 'run', '/home/vagrant/Eggs/Products.CMFPlone-5.1b4-py2.7.egg/Products/CMFPlone/_scripts/_generate_gruntfile.py']' returned non-zero exit status 1

What version of Plone/ Addons I am using:

Plone 5.1b4 collective.solr 6.0a2

gp54321 commented 6 years ago

For the record, I tried just that with 5.1rc2 (well, plone-5.1-latest on dist.plone.org) and have not seen this problem. The compilation succeeded and generated new files in Products/CMFPlone/static. Can you reproduce it now ?

davisagli commented 2 years ago

Plone 6 no longer uses this command for compilation