[Grok-dev] Re: How do I track down a zope.configuration.config.ConfigurationConflictError

Philipp von Weitershausen philipp at weitershausen.de
Thu Feb 21 14:56:02 EST 2008


Sebastian Ware wrote:
> In the traceback bellow. How do I figure out what the conflict is?

By reading the traceback carefully ;). I admit, though, that the 
traceback is mostly geared towards ZCML currently and may be a bit 
misleading.

There's actually a very straight-forward way of equipping the 
configuration machinery with the right information so that tracebacks 
look meaningful. We could use this so that the traceback would quote our 
Python code instead of some meaningless ZCML. This, however, will 
involve changing either Martian or the grokkers to annotate the 
configuration context with the information accordingly, which isn't 
always easy because I'm not sure if you can get this info from classes, 
for example (you *can* get it from function objects through their code 
objects). This is why I chickened out of it during the initial move 
towards configuration action, and left it for another day.

> Traceback (most recent call last):
...
> zope.configuration.config.ConfigurationConflictError: Conflicting 
> configuration actions

This line is the interesting one. It contains the discriminator by which 
conflicts are detected. It looks as if you're trying to register two 
views ('adapter' discriminator) for the ProtonCMS class called 'add_table'.

>   For: ('adapter', (<class 'prestatics.app.ProtonCMS'>, <InterfaceClass 
> zope.publisher.interfaces.browser.IDefaultBrowserLayer>), 
> <InterfaceClass zope.interface.Interface>, 'add_table')
>     File 
> "/Users/jhsware/groksandbox/Prestatics/src/prestatics/configure.zcml", 
> line 4.2-4.27
>         <grok:grok package="." />
>     File 
> "/Users/jhsware/groksandbox/Prestatics/src/prestatics/configure.zcml", 
> line 4.2-4.27
>         <grok:grok package="." />

Here's another conflict. It looks like you're registering two adapters 
for IProtonWorkflowItem.

>   For: ('adapter', <InterfaceClass 
> prestatics.interfaces.IProtonWorkflowItem>, None, '')
>     File 
> "/Users/jhsware/groksandbox/Prestatics/src/prestatics/configure.zcml", 
> line 4.2-4.27
>         <grok:grok package="." />
>     File 
> "/Users/jhsware/groksandbox/Prestatics/src/prestatics/configure.zcml", 
> line 4.2-4.27
>         <grok:grok package="." />



More information about the Grok-dev mailing list