[Zope-dev] Five registerPackage results in unresolved ConflictError

Sasha Vincic sasha.vincic at gmail.com
Fri May 16 06:03:05 EDT 2008


Hi
On a server we have a ZEO server with 6 clients. When we start/restart the
server we often get on random instance an AttributeError @@plone and all
other browser pages. I have tracked it down to a ConflictError when
installing Five on startup. See traceback bellow. To solve this I tried to
set enable-product-installation = off to all except one instance but I still
got errors.
For now we restart the broken instances until they work, I have tried to set
sleeping times up to couple seconds between the instances but it didn't make
any difference.

Five fails when it tries to execute the registerPackage in zcml files. Not
the same product every time.
First I thought it didn't respect the enable-product-instalation but that is
checked in App.Product.initializeProduct method.
So I played in fiveconfigure.py with transaction.savepoint() but no success
but if I manually check App.Product.doInstall like in the diff below

Now my question is if this is correct solution for the problem or will it
have other side effects that I am not aware of? How do I write tests for an
ConflicError during startup?

/Sasha

Index: fiveconfigure.py


===================================================================


--- fiveconfigure.py    (revision 86781)


+++ fiveconfigure.py    (working copy)


@@ -23,7 +23,7 @@


 import warnings





 import App.config


-from App.Product import initializeProduct


+from App.Product import initializeProduct, doInstall


 from App.ProductContext import ProductContext


 import Products


 from zLOG import LOG, ERROR


@@ -265,6 +265,8 @@


     if not hasattr(module_, '__path__'):


         raise ValueError("Must be a package and the " \


                          "package must be filesystem based")


+    if not doInstall():


+        return





     app = Zope2.app()


     try:




2008-05-16 11:48:17 ERROR Zope Couldn't install Five
Traceback (most recent call last):
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 783, in install_product
    initmethod(context)
  File
"/Users/sasha/Development/eea-buildout-clean/products/Five/__init__.py",
line 31, in initialize
    zcml.load_site()
  File "/Users/sasha/Development/eea-buildout-clean/products/Five/zcml.py",
line 41, in load_site
    _context = xmlconfig.file(file)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 560, in file
    context.execute_actions()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/config.py",
line 612, in execute_actions
    callable(*args, **kw)
  File
"/Users/sasha/Development/eea-buildout-clean/products/Five/fiveconfigure.py",
line 285, in _registerPackage
    transaction.commit()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_manager.py",
line 96, in commit
    return self.get().commit(sub, deprecation_wng=False)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 380, in commit
    self._saveCommitishError() # This raises!
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 378, in commit
    self._commitResources()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 433, in _commitResources
    rm.commit(self)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py",
line 484, in commit
    self._commit(transaction)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py",
line 518, in _commit
    raise ConflictError(object=obj)
ConfigurationExecutionError: ZODB.POSException.ConflictError: database
conflict error (oid 0x28f61f, class App.Product.Product)
  in:
  File
"/Users/sasha/Development/eea-buildout-clean/src/plone.session/plone/session/configure.zcml",
line 5.4-5.65
      <five:registerPackage package="." initialize=".initialize" />

Traceback (most recent call last):
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py",
line 56, in ?
    run()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py",
line 21, in run
    starter.prepare()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py",
line 98, in prepare
    self.startZope()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py",
line 257, in startZope
    Zope2.startup()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/__init__.py",
line 47, in startup
    _startup()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/App/startup.py",
line 103, in startup
    OFS.Application.initialize(application)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 304, in initialize
    initializer.initialize()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 333, in initialize
    self.install_products()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 605, in install_products
    return install_products(app)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 636, in install_products
    folder_permissions, raise_exc=debug_mode)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py",
line 783, in install_product
    initmethod(context)
  File
"/Users/sasha/Development/eea-buildout-clean/products/Five/__init__.py",
line 31, in initialize
    zcml.load_site()
  File "/Users/sasha/Development/eea-buildout-clean/products/Five/zcml.py",
line 41, in load_site
    _context = xmlconfig.file(file)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 560, in file
    context.execute_actions()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/config.py",
line 612, in execute_actions
    callable(*args, **kw)
  File
"/Users/sasha/Development/eea-buildout-clean/products/Five/fiveconfigure.py",
line 285, in _registerPackage
    transaction.commit()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_manager.py",
line 96, in commit
    return self.get().commit(sub, deprecation_wng=False)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 380, in commit
    self._saveCommitishError() # This raises!
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 378, in commit
    self._commitResources()
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py",
line 433, in _commitResources
    rm.commit(self)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py",
line 484, in commit
    self._commit(transaction)
  File
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py",
line 518, in _commit
    raise ConflictError(object=obj)
zope.configuration.config.ConfigurationExecutionError:
ZODB.POSException.ConflictError: database conflict error (oid 0x28f61f,
class App.Product.Product)
  in:
  File
"/Users/sasha/Development/eea-buildout-clean/src/plone.session/plone/session/configure.zcml",
line 5.4-5.65
      <five:registerPackage package="." initialize=".initialize" />
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-dev/attachments/20080516/cf93ad22/attachment-0001.html


More information about the Zope-Dev mailing list