Plone.resourceregistries.scripts error

I upgraded a site from 5.0.x to 5.1b3 and it gives me the following error:

error while rendering plone.resourceregistries.scripts error while rendering plone.resourceregistries.styles

Is there a workaround here ( I did try to rerun a lot of /portal_setup profiles )

ooops, forgot this:

2017-04-19 20:32:52 ERROR plone.app.viewletmanager Error while rendering viewlet-manager=plone.htmlhead.links, viewlet=plone.resourceregistries.styles
Traceback (most recent call last):
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/plone.app.viewletmanager-2.0.10-py2.7.egg/plone/app/viewletmanager/manager.py", line 112, in render
    html.append(viewlet.render())
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/plone.app.layout-2.6.5-py2.7.egg/plone/app/layout/viewlets/common.py", line 59, in render
    return self.index()
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/Five/browser/pagetemplatefile.py", line 125, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/Five/browser/pagetemplatefile.py", line 59, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/five.pt-2.2.4-py2.7.egg/five/pt/engine.py", line 98, in __call__
    return self.template.render(**kwargs)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/z3c.pt-3.0.0a1-py2.7.egg/z3c/pt/pagetemplate.py", line 163, in render
    return base_renderer(**context)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/zpt/template.py", line 261, in render
    return super(PageTemplate, self).render(**vars)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 191, in render
    raise_with_traceback(exc, tb)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 171, in render
    self._render(stream, econtext, rcontext)
  File "c780b63edbb6890663a336b3313a781a.py", line 88, in render
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/five.pt-2.2.4-py2.7.egg/five/pt/expressions.py", line 161, in __call__
    return base()
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Products.CMFPlone-5.1b3-py2.7.egg/Products/CMFPlone/resources/browser/styles.py", line 90, in styles
    result = self.ordered_bundles_result()
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Products.CMFPlone-5.1b3-py2.7.egg/Products/CMFPlone/resources/browser/resource.py", line 232, in ordered_bundles_result
    self.get_data(bundle, result)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Products.CMFPlone-5.1b3-py2.7.egg/Products/CMFPlone/resources/browser/styles.py", line 55, in get_data
    if not bundle.last_compilation\
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Products.CMFPlone-5.1b3-py2.7.egg/Products/CMFPlone/resources/bundle.py", line 79, in last_compilation
    loc, path = self._real_path(ctx)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Products.CMFPlone-5.1b3-py2.7.egg/Products/CMFPlone/resources/bundle.py", line 36, in _real_path
    resource = getSite().restrictedTraverse(resource_path)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Traversable.py", line 317, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  File "/home/medialog/plone5/ektedata8084/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Traversable.py", line 300, in unrestrictedTraverse
    raise e
KeyError: 'styles.css'

 - Expression: "view/styles"
 - Filename:   ... -py2.7.egg/Products/CMFPlone/resources/browser/styles.pt
 - Location:   (line 1: col 26)
 - Source:     <tal:styles repeat="style view/styles"
                                         ^^^^^^^^^^^

@zopyx I noticed you have this error too (on the XML director demo site)

@zopyx

turns out

pp/client/plone/browser/resources/styles.css

is missing..

Are you saying this is a bug? If so, could you please file the issue?

It is a bug in the pp.client add-on

(if it is a bug that an add on can break a site like that is another question (?) )

I'm having the dreaded resource registries issue now!
It isn't related to pp.client since I don't have pp.client.

error while rendering plone.resourceregistries.scripts error while rendering plone.resourceregistries.styles

I know this is a long time ago but @espenmn how did you trace the issue?

Took a look at my logs and I'm seeing this keyerror:

KeyError: 'collective.js.jqueryui.custom.min.js'

I think this might be the culprit.

It turns out that the collective.js.jqueryui package provides the "machinery" related to the collective.js.jqueryui.custom.min.js key. I had to add collective.js.jqueryui as a dependency and rerun buildout.

Hopefully I can totally remove collective.js.jqueryui as a dependency shortly.

There was an entry in a ZCML file for a stylesheet that did not exist.

So I just added an empty styles.css in the add-on.

In your case, I would install one and one add on and see if you get an error. If you do: check if all the files for the entries exist (in registry.xml of that add on).

UPDATE: I see you found the answer.

1 Like