[Zope] Zcatalog and random numerical key error

Kent Polk kent@goatnospamhill.org
2 Feb 2000 22:47:12 GMT


On 25 Jan 2000 07:20:00 -0600, Michel Pelletier wrote:
>
>> From: - [mailto:kedai@kedai.com.my]
>> 
>> situation:
>> got a zclass, that is catalog aware.  when searches are made, 
>> some return
>> results, while other times it returns random numerical key 
>> error.  i remembered
>> seeing this symptom on zope.org last year.  but it has now 
>> disappeared. 
>> anybody got a clue on what's going on?
>
>Your Catalog has gotten out of sync, just click 'Update Catalog' and it
>will fix itself.  It's due to asking for uid of a record that is no
>longer cataloged.  I don't know what could have caused it in your case,
>probably something in your DTML methods for the ZClass.

I have a similar situation where I have nested ZClass instances which
catalog property changes with:

 <dtml-call "propertysheets.za_items.manage_changeProperties(REQUEST)">
 <dtml-call reindex_object>

The problem is apparently that the base instance contains the
catalog, the catalog got out of sync, I 'updated' and all objects
*except* the base instance recovered. I can't edit the base instance
properties without removing the above lines from ZClass property
edit method.

File /opt1/pkg/share/zope/lib/python/Products/ZCatalog/Catalog.py,
 line 373, in uncatalogObject

Error type:  ValueError
Error value: Uncatalog of absent id 'utips'

Now I suppose the catalog should be above the base instance, but
I need for each ZClass instance tree to have its own catalog. As
long as the catalog doesn't get out of sync, or I don't delete the
catalog or the catalog item that refers to the base instance, all
is ok.

How do I get around the problem of 'uncataloging' a catalog id that
doesn't exist when I want to update a catalog-aware instance?

Thanks