[Zope-dev] Index errors revisited: KeywordIndex unindex_object could not remove documentId -883140122 from index ComponentVersions. This should not happen.

Florent Guillaume fg@nuxeo.com
Thu, 27 Feb 2003 19:04:33 +0100


In article <3E5E247B.6050607@upfrontsystems.co.za> you write:
> We run a script which iterates over 719 <ZClass License> instances.
> For each instance, either one or two <ZClass Reminder> instances
> are created and edited. The script completes, logging all the way:
> 
> 2003-02-27T09:43:44 INFO(0) MyDebugLog
> recreate_reminders> INFO: creating reminders for License_99
> 
> Then, Zope starts spitting out 657 errors like the following:
> 
> 2003-02-27T09:43:49 ERROR(200) KeywordIndex unindex_object could not 
> remove documentId -883140119 from index ComponentVersions.  This should 
> not happen.
> Traceback (innermost last):
>    File 
> /usr/local/zope/2-5-1/lib/python/Products/PluginIndexes/common/UnIndex.py, 
> line 168, in removeForwardIndexEntry
>      (Object: ComponentVersions)
> KeyError: -883140119
> 
> Most of these errors are identical. There are 172 unique errors,
> the rest are all retries. The 172 keys are not in the catalog.
> The only indexes involved are ComponentVersions and NodeNames,
> both 'lines' properties of <ZClass Reminder>.
> 
> Does anyone know how to cause this, so that I can stop doing it?
> I'm trying to narrow it down again ..
> 
>   (Zope 2.5.1 (source release, python 2.1, linux2), python 2.1.3, linux2)


It would be interesting to test it with Zope 2.6.1... I'd hate to debug
something that has already been fixed.

To debug it, I'd log a full backtrace by patching UnIndex.py line 168
when the KeyError is raised. But I don't know enough about the catalog
to debug deeper. An invariant is being broken somewhere. Maybe because
of a too-greedy try/except: ?

Which reminds me, there is such a greedy one in manage_beforeDelete, it
could be your culprit.

BTW are you using CMF?

Florent


-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com