<br><br><div class="gmail_quote">On Tue, May 20, 2008 at 8:30 PM, Rob Miller <<a href="mailto:ra@burningman.com">ra@burningman.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">Philipp von Weitershausen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Believe something very very rotten in Five's registerPackage was fixed by Rocky in r72986 [1]. As far as I can tell this was never merged to the 1.4 branch, but I could we wrong.<br>
</blockquote>
</div></blockquote><div><br></div><div>This seams to work when you start instances without debug, which production is but it still fails the same way with debug on.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d"><br></div>
i can confirm that this seems to be helping. there's an easier way to generate the error that Sasha is seeing... you can reliably reproduce it on Zope 2.9.x w/ Five 1.4 just by starting a zeo server with no Data.fs file, and then trying to connect with a zeo client. if you have any <five:registerPackage> tags, the first connection will _always_ fail with a ConflictError. subsequent connections will work, but the initial one will fail. (we've had to put a './zopectl run do_nothing.py' steps into our build code... :-P)<br>
</blockquote><div><br></div><div>So you run ./zopectl run do_nothing.py before you started each instance? Is that better then my doInstall() check?</div><div><br></div><div>/Sasha</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
anyway, the error is not happening with Zope 2.10 and Five <a href="http://1.5.6." target="_blank">1.5.6.</a> glad to know it's been resolved. :-)<br><font color="#888888">
<br>
-r</font><div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[1] <a href="http://svn.zope.org/?rev=72986&view=rev" target="_blank">http://svn.zope.org/?rev=72986&view=rev</a><br>
<br>
<br>
Sasha Vincic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Forgot to say that this is Zope 2.9.8, Five 1.4 branch from svn, Plone 2.5.5<br>
<br>
/Sasha<br>
<br>
On Fri, May 16, 2008 at 12:03 PM, Sasha Vincic <<a href="mailto:sasha.vincic@gmail.com" target="_blank">sasha.vincic@gmail.com</a> <mailto:<a href="mailto:sasha.vincic@gmail.com" target="_blank">sasha.vincic@gmail.com</a>>> wrote:<br>
<br>
Hi<br>
<br>
On a server we have a ZEO server with 6 clients. When we<br>
start/restart the server we often get on random instance an<br>
AttributeError @@plone and all other browser pages. I have tracked<br>
it down to a ConflictError when installing Five on startup. See<br>
traceback bellow. To solve this I tried to set<br>
enable-product-installation = off to all except one instance but I<br>
still got errors.<br>
For now we restart the broken instances until they work, I have<br>
tried to set sleeping times up to couple seconds between the<br>
instances but it didn't make any difference.<br>
<br>
Five fails when it tries to execute the registerPackage in zcml<br>
files. Not the same product every time.<br>
First I thought it didn't respect the enable-product-instalation but<br>
that is checked in App.Product.initializeProduct method. So I played in fiveconfigure.py with transaction.savepoint() but no<br>
success but if I manually check App.Product.doInstall like in the<br>
diff below<br>
Now my question is if this is correct solution for the problem or<br>
will it have other side effects that I am not aware of? How do I<br>
write tests for an ConflicError during startup?<br>
<br>
/Sasha<br>
<br>
Index: fiveconfigure.py ===================================================================<br>
--- 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:<br>
<br>
<br>
<br>
2008-05-16 11:48:17 ERROR Zope Couldn't install Five<br>
Traceback (most recent call last):<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 783, in install_product<br>
initmethod(context)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/__init__.py",<br>
line 31, in initialize<br>
zcml.load_site()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/zcml.py",<br>
line 41, in load_site<br>
_context = xmlconfig.file(file)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/xmlconfig.py", <br>
line 560, in file<br>
context.execute_actions()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/config.py", <br>
line 612, in execute_actions<br>
callable(*args, **kw)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/fiveconfigure.py", <br>
line 285, in _registerPackage<br>
transaction.commit()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_manager.py", <br>
line 96, in commit<br>
return self.get().commit(sub, deprecation_wng=False)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 380, in commit<br>
self._saveCommitishError() # This raises!<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 378, in commit<br>
self._commitResources()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 433, in _commitResources<br>
rm.commit(self)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py", <br>
line 484, in commit<br>
self._commit(transaction)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py", <br>
line 518, in _commit<br>
raise ConflictError(object=obj)<br>
ConfigurationExecutionError: ZODB.POSException.ConflictError:<br>
database conflict error (oid 0x28f61f, class App.Product.Product)<br>
in:<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/src/plone.session/plone/session/configure.zcml", <br>
line 5.4-5.65<br>
<five:registerPackage package="." initialize=".initialize" /><br>
<br>
Traceback (most recent call last):<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py", <br>
line 56, in ?<br>
run()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py", <br>
line 21, in run<br>
starter.prepare()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py", <br>
line 98, in prepare<br>
self.startZope()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py", <br>
line 257, in startZope<br>
Zope2.startup()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/__init__.py", <br>
line 47, in startup<br>
_startup()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/App/startup.py", <br>
line 103, in startup<br>
OFS.Application.initialize(application)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 304, in initialize<br>
initializer.initialize()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 333, in initialize<br>
self.install_products()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 605, in install_products<br>
return install_products(app)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 636, in install_products<br>
folder_permissions, raise_exc=debug_mode)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py", <br>
line 783, in install_product<br>
initmethod(context)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/__init__.py",<br>
line 31, in initialize<br>
zcml.load_site()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/zcml.py",<br>
line 41, in load_site<br>
_context = xmlconfig.file(file)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/xmlconfig.py", <br>
line 560, in file<br>
context.execute_actions()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/config.py", <br>
line 612, in execute_actions<br>
callable(*args, **kw)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/products/Five/fiveconfigure.py", <br>
line 285, in _registerPackage<br>
transaction.commit()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_manager.py", <br>
line 96, in commit<br>
return self.get().commit(sub, deprecation_wng=False)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 380, in commit<br>
self._saveCommitishError() # This raises!<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 378, in commit<br>
self._commitResources()<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py", <br>
line 433, in _commitResources<br>
rm.commit(self)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py", <br>
line 484, in commit<br>
self._commit(transaction)<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py", <br>
line 518, in _commit<br>
raise ConflictError(object=obj)<br>
zope.configuration.config.ConfigurationExecutionError:<br>
ZODB.POSException.ConflictError: database conflict error (oid<br>
0x28f61f, class App.Product.Product)<br>
in:<br>
File<br>
"/Users/sasha/Development/eea-buildout-clean/src/plone.session/plone/session/configure.zcml", <br>
line 5.4-5.65<br>
<five:registerPackage package="." initialize=".initialize" /><br>
<br>
</blockquote></blockquote>
<br>
_______________________________________________<br>
Zope-Dev maillist - <a href="mailto:Zope-Dev@zope.org" target="_blank">Zope-Dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a><br>
** No cross posts or HTML encoding! **<br>
(Related lists - <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a> )<br>
</div></div></blockquote></div><br>