bookieio / Bookie

Python based delicious.com replacement
GNU Affero General Public License v3.0
633 stars 138 forks source link

UnknownFieldError in celery backend processing #503

Closed jcharaoui closed 10 years ago

jcharaoui commented 10 years ago

At first glance the error doesn't seem to affect the fulltext indexing.

sep 04 01:07:55 ware bookie[19095]: [2014-09-04 01:07:55,650: ERROR/MainProcess] Task bookie.bcelery.tasks.fulltext_index_bookmark[12d40edb-a07d-4dc7-a1cd-82554e85831d] raised exception: UnknownFieldError("No field named 'is_private' in <Schema: ['bid', 'description', 'extended', 'readable', 'tags']>",)
sep 04 01:07:55 ware bookie[19095]: Traceback (most recent call last):
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/celery/task/trace.py", line 233, in trace_task
sep 04 01:07:55 ware bookie[19095]: R = retval = fun(*args, **kwargs)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/celery/task/trace.py", line 420, in __protected_call__
sep 04 01:07:55 ware bookie[19095]: return self.run(*args, **kwargs)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/bookie/bcelery/tasks.py", line 271, in fulltext_index_bookmark
sep 04 01:07:55 ware bookie[19095]: is_private=b.is_private,
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/whoosh/writing.py", line 449, in update_document
sep 04 01:07:55 ware bookie[19095]: self._record("update_document", args, kwargs)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/whoosh/writing.py", line 426, in _record
sep 04 01:07:55 ware bookie[19095]: getattr(self.writer, method)(*args, **kwargs)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/whoosh/writing.py", line 356, in update_document
sep 04 01:07:55 ware bookie[19095]: self.add_document(**fields)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/whoosh/filedb/filewriting.py", line 352, in add_document
sep 04 01:07:55 ware bookie[19095]: self._check_fields(schema, fieldnames)
sep 04 01:07:55 ware bookie[19095]: File "/usr/local/share/Bookie/local/lib/python2.7/site-packages/whoosh/filedb/filewriting.py", line 340, in _check_fields
sep 04 01:07:55 ware bookie[19095]: % (name, schema))
sep 04 01:07:55 ware bookie[19095]: None: No field named 'is_private' in <Schema: ['bid', 'description', 'extended', 'readable', 'tags']>
lines 491-549/549 (END)
mitechie commented 10 years ago

Ah, this is the fulltext schema is updated. We don't have a migration path. You have to remove the directory that stores the fulltext data and then regenerate it using the admin api to rebuild it.

This is part of the adding of private bookmarks feature.

The bookie cli tool provides an admin 'reindex' command that hits the api to rebuild the index.

https://github.com/bookieio/bookie_api/blob/master/src/bookie_api/client.py#L229

jcharaoui commented 10 years ago

Thanks. That did the trick.