[Zope] Key Error in Catalog Reindex

Dieter Maurer dieter at handshake.de
Mon Jan 22 13:53:35 EST 2007


KJZZ Webmaster wrote at 2007-1-22 09:53 -0700:
>I am using zope 2.8.1. and am using the following dtml method to reindex
>the catalog:
>
><dtml-let URL1=HTTP_REFERER>
><dtml-call "Catalog.manage_catalogReindex(REQUEST, RESPONSE, URL1)">
><dtml-call expr="RESPONSE.redirect(URL1)">
></dtml-let>
>
>However, midway through the reindex, I am receiving the following error message:
>
>Traceback (innermost last):
>  Module ZPublisher.Publish, line 113, in publish
>  Module ZPublisher.mapply, line 88, in mapply
>  Module ZPublisher.Publish, line 40, in call_object
>  Module OFS.DTMLMethod, line 153, in __call__
>   - <DTMLMethod at /somepath/somedtmlmethod>
>   - Physical Path: //somepath/somedtmlmethod
>KeyError: 'validate'
>
>I checked the zope source file here:
>
>Zope-2.8.1-final\lib\python\OFS\DTMLMethod.py
>
>and found the reference to the "validate" method in line 128:
>
>        if self.__dict__.has_key('validate'):
>            first_time_through = 0
>        else:
>            self.__dict__['validate'] = security.DTMLValidate
>            first_time_through = 1
>        try:
>
>My questions are these:
>
>a) what changes could I to the catalog to avoid this error in the future?

Your problem is not in the catalog.

If the "KeyError: 'validate'" really comes from the code
snippet above, then you have a "DTMLMethod" with a very
strange "__dict__". A normal dict would not raise
a "KeyError: 'validate'", even when 'validate' indeed does not exist.


If fear, this problem is big enough that debugging is necessary.

> ...
>Is the catalog getting too large, and maybe the reindex is taking too long
>to complete?

No (there is no limit on the catalog size. It may just get a bit slower).

>b) are there any changes to the script \lib\python\OFS\DTMLMethod.py that
>I could make which would eliminate, or at least render this error message
>harmless?

Unlikely. The code (as least the quoted one) should work...



-- 
Dieter


More information about the Zope mailing list