Hello,<br><br> It seems that there is an issue with registering local utilities on a Product install. It seems that on a product reinstall, the local utility is re-registered. In doing so, you lose all data that the local utility was managing. <br>
<br>Martin Aspeli pointed out,<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I think the problem is in Products.GenericSetup.components - in _initUtilities it does<br>
<br>
elif factory is not None:<br>
self.context.registerUtility(factory(), provided, name)<br>
<br>
without first checking of a utility with this name for this interface already exists.</blockquote><br>Although, from what I've found, this is not the problem. By stepping through the code, I found in this context, the local utility no longer exists. So at some point in the install reinstall process it is unregistered.<br>
<br>Looking deeper, I found that in the reinstall of a product the method _cascadeRemove() is called from Products.CMFQuickInstallerTool.InstalledProduct that unregisters all utilities.<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
if 'utilities' in cascade:<br> utilities = getattr(self, 'utilities', [])<br> if utilities:<br> sm = getSiteManager()<br> for registration in utilities:<br>
provided = _resolveDottedName(registration[0])<br> name = registration[1]<br> if queryUtility(provided, name=name) is not None:<br> sm.unregisterUtility(provided=provided, name=name)</blockquote>
<div><br>The stack trace is like so,<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZServer/PubCore/ZServerPublisher.py(25)__init__()<br>
-> response=b)<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(401)publish_module()<br>-> environ, debug, request, response)<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(202)publish_module_standard()<br>
-> response = publish(request, module_name, after_list, debug=debug)<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(119)publish()<br>-> request, bind=1)<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/mapply.py(88)mapply()<br>
-> if debug is not None: return debug(object,args,context)<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(42)call_object()<br>-> result=apply(object,args) # Type s<cr> to step into published object.<br>
<string>(6)_facade()<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/AccessControl/requestmethod.py(64)_curried()<br>-> return callable(*args, **kw)<br> /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/QuickInstallerTool.py(639)reinstallProducts()<br>
-> self.uninstallProducts(products, cascade, reinstall=True)<br> <string>(4)_facade()<br> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/AccessControl/requestmethod.py(64)_curried()<br>-> return callable(*args, **kw)<br>
/Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/QuickInstallerTool.py(621)uninstallProducts()<br>-> prod.uninstall(cascade=cascade, reinstall=reinstall)<br> /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(297)uninstall()<br>
-> self._cascadeRemove(cascade)<br> /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(386)_cascadeRemove()<br>-> sm.unregisterUtility(provided=provided, name=name)<br>> /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/zope/component/registry.py(102)unregisterUtility()<br>
</blockquote> <br>I don't know how to go about fixing this problem since the infrastructure is not set up to handle this. Realistically, if there is an uninstall of a component needed, I would think it could be handled in the Products.GenericSetup.components class. <br>
<br>Any ideas to help me get around this problem would be greatly appreciated.<br><br><br>Thanks,<br>Nathan Van Gheem<br></div>