[Zope-dev] products not found when initializing zodb

Dieter Maurer dieter at handshake.de
Sun Sep 30 13:07:49 EDT 2007


Wichert Akkerman wrote at 2007-9-30 14:10 +0200:
>(I've filed this at https://bugs.launchpad.net/zope2/+bug/147201 as well)
>
>For a Plone site I am using a separate ZODB for the catalog so I can
>tune it a bit. I do this using the standard method in zope.conf:
>
><zodb_db catalog>
>  mount-point /plone.org/portal_catalog
>  container-class Products.CMFPlone.CatalogTool.CatalogTool
>  <zeoclient>
>    server 127.0.0.1:5010
>    storage 2
>    name catalogstorage
>    var /srv/plone.org/buildout/parts/instance1/var
>  </zeoclient>
></zodb_db>
>
>This works perfect in a normal Zope2 instance. But when I use buildout
>CMFPlone is stored in a separate directory that is listed in a products
>line in zope.conf:
>
>instancehome /srv/plone.org/buildout/parts/instance1
>products /srv/plone.org/buildout/products
>products /srv/plone.org/buildout/parts/productdistros
>products /srv/plone.org/buildout/parts/plone
>
>the result is that Zope no longer starts:
>
>Error: The object named by "Products.CMFPlone.CatalogTool.CatalogTool" could not be imported
>Traceback (most recent call last):
>  File "/srv/plone.org/buildout/parts/zope2/lib/python/Zope2/Startup/datatypes.py", line 94, in importable_name
>    package = __import__(n, g, g, component)
>ImportError: No module named CMFPlone
>
>
>which is a bit of a showstopper for this deployment. Does anyone know how this
>can be fixed or worked around?

It has been discussed serveral times.

The problem is almost surely a phase problem:

  The existence of paths and modules are checked right away during
  processing of the configuration file.

  If the "products" line has not yet be processed fully, then
  the module existence check will fail.

ZConfig has a means to execute part of the configuration in so called
handlers. The handlers are executed after the configuration file
has been fully parsed.

I do not know whether the "products" declaration is executed
directly or only in a handler.
In the first case, you have a chance to restructure your
configuration file such that the "products" declaration
preceeds the "Products.CMFPlone" use.
In the second case, you may perhaps link CMFPlone into the
standard "$INSTANCE_HOME/Products".



-- 
Dieter


More information about the Zope-Dev mailing list