[Grok-dev] Catalog/Indexes/Search error

Souheil CHELFOUH trollfot at gmail.com
Thu Jan 7 07:29:57 EST 2010


I have experienced that several times. It was caused by the indexes grokking
When an error happens there, the catalog and the int id utiliy are
*not* created.
I'd have to take some time to investigate all that.

It's not common, but i've faced it before
It probably comes from the set of versions.

2010/1/7 Paul Wilson <paulalexwilson at gmail.com>:
> 2010/1/7 Kathy Manwaring <kathy at perfectnotes.com.au>:
>> Please, if anyone can help with this, I really need it!
>
> I took the steps to recreate your problem, and experienced everything
> that you did. Versioning problems in version.cfg, character encoding
> problems in app.py, and so on. (So if it makes you feel any better,
> you're not alone :-))
>
> Your latest problem; the component error on grok.View is because the
> view doesn't know how to actually display the content. It requires a
> template named protonsearch.pt within the app_templates directory that
> will render the search page, OR a render method that returns a string
> representation of the proton search page.
>
> *Sebastian" : surely your project had either:
>  * a render method on <class 'ProtonSearch'>?
>  * a template in app_templates called protonsearch.pt?
>  * or a grok.name directive on ProtonSearch that names some sort of
> template to render the search page?
>
> I've added a render method as an expedient and now I get:
>
>  File "/home/wilson/.buildout/eggs/zope.component-3.4.0-py2.5.egg/zope/component/_api.py",
> line 207, in getUtility
>    raise ComponentLookupError(interface, name)
> ComponentLookupError: (<InterfaceClass zope.app.intid.interfaces.IIntIds>, '')
>
> As you have Kathy. I've included the full traceback as a text file.
>
> The good news Kathy is that it doesn't look like you've done anything
> wrong. The bad news is that it looks like something is broken in zope
> somewhere:
>
> TypeError: ('Could not adapt', Unauthorized(<grokui.admin.view.Index
> object at 0xa12776c>, 'browserDefault', 'grok.ManageApplications'),
> <InterfaceClass zope.traversing.interfaces.IPhysicallyLocatable>)
> TypeError: ('Could not adapt', NotFound(), <InterfaceClass
> zope.traversing.interfaces.IPhysicallyLocatable>)
> ComponentLookupError: (<InterfaceClass zope.app.intid.interfaces.IIntIds>, '')
>
> When I remove everything and end up back at a very basic application -
> the add works. Incrementally adding classes back narrows the problem
> down to the class:
>
> -------------------------------%<-----------------------------
>  54 class ContentIndexes(grok.Indexes):
>  55     """
>  56     This is where I setup my indexes. I have two indexes;
>  57     one full-text index called "text_body",
>  58     one field index called "body".
>  59     """
>  60     grok.site(searchtut)
>  61
>  62     grok.context(IProtonObject)
>  63     # grok.context() tells Grok that objects implementing
>  64     # the interface IProtonObject should be indexed.
>  65
>  66     grok.name('proton_catalog')
>  67     # grok.name() tells Grok what to call the catalog.
>  68     # if you have named the catalog anything but "catalog"
>  69     # you need to specify the name of the catalog in your
>  70     # queries.
>  71
>  72     text_body = index.Text(attribute='body')
>  73     body = index.Field(attribute='body')
>  74     # The attribute='body' parameter is actually unnecessary if
> the attribute to
>  75     # be indexed has the same name as the index.
> -----------------------%<-----------------------------
>
> After a bit of poking, this let me to a rather curious line in meta.py
> that registers the indexes:
>
> from zope.intid import IntIds
> from zope.intid.interfaces import IIntIds
>
> but zope is looking for:
>
> ComponentLookupError: (<InterfaceClass zope.app.intid.interfaces.IIntIds>, '')
>
> zope.app.intid.interfaces BBB imports IIntIds from zope.intid so there
> shouldn't be a problem here. I don't
>
> *Grok team*. Adding indexes to Grok applications breaks application
> creation. It may be something to do with the 'versions.cfg' that Kathy
> is using, If it isn't, it looks like a bug.
>
> Any ideas?
>
> Thanks,
> Paul
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>
>


More information about the Grok-dev mailing list