Comment 1 for bug 1375882

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

This is caused by moving KarlPGTextIndex from karlserve to karl--the dotted path name to the class has changed so we can't unpickle the old index and end up with a broken object. The fix is pretty easy--just instantiate a new index and stick it in the right place. Because we're a little worried about being able to roll back easily, I'll just post this as a snippet that can be run in bin/debug. To roll back just import KarlPGTextIndex from the old location in karlserve and do the exact same thing:

chris@curiosity:~/proj/karl/devless$ bin/debug
Python 2.6.9 (unknown, Mar 21 2014, 10:34:41)
[GCC 4.8.1] on linux3
Type "help" for more information. "app" is the karl Pyramid application.
>>> import transaction
>>> from karl.textindex import KarlPGTextIndex
>>> from karl.models.site import get_weighted_textrepr
>>> root.catalog['texts'] = KarlPGTextIndex(get_weighted_textrepr)
>>> transaction.commit()
>>>

Also, you might end up with more than one text index as a result of past reindex operations. If there is a 'new_texts' index, remove it:

Python 2.6.9 (unknown, Jan 8 2014, 15:38:00)
[GCC 4.5.4] on linux2
Type "help" for more information. "app" is the karl Pyramid application.
>>> root.catalog.keys()
['creator', 'member_name', 'creation_date', 'texts', 'titlestartswith', 'allowed', 'modified_date', 'modified_by', 'content_modified', 'virtual', 'email', 'end_date', 'tags', 'interfaces', 'lastfirst', 'publication_date', 'mimetype', 'name', 'title', 'start_date', 'containment', 'path', 'new_texts']
>>> del root.catalog['new_texts']
>>> import transaction
>>> transaction.commit()
>>>

I've done this on staging and it fixes the problem.