I have created a ticket #773 for the problem reported.

All uses of doc['product'] were replaced with doc.get('product') in
r1573264, which should fix your issue.

Issue probably appeared after we removed the whoosh fix in r1566160.
Before, documents for resources without product has product "(empty)".

#773: https://issues.apache.org/bloodhound/ticket/773

2014-02-28 21:51 GMT+01:00 Ryan Ollos <[email protected]>:
> On Fri, Feb 28, 2014 at 12:42 PM, Fabio Jun Takada Chino <
> [email protected]> wrote:
>
>> Hi,
>>
>> When I tried to run the command "bhsearch rebuild", I got the message:
>>
>>     KeyError: 'product'
>>
>> After this error, the search stopped to work as the index is no longer
>> there.
>>
>> Looking into the log, I found out the following stacktrace:
>>
>>     2014-02-28 16:52:05,770 Trac[console] ERROR: Exception in trac-admin
>>     command:
>>     Traceback (most recent call last):
>>       File "/home/bloodhound/0.7/trac/trac/admin/console.py", line 109,
>>     in onecmd
>>         rv = cmd.Cmd.onecmd(self, line) or 0
>>       File "/usr/lib/python2.7/cmd.py", line 220, in onecmd
>>         return self.default(line)
>>       File "/home/bloodhound/0.7/trac/trac/admin/console.py", line 285,
>>     in default
>>         return cmd_mgr.execute_command(*args)
>>       File "/home/bloodhound/0.7/trac/trac/admin/api.py", line 124, in
>>     execute_command
>>         return f(*fargs)
>>       File "/home/bloodhound/0.7/bloodhound_search/bhsearch/api.py",
>>     line 344, in rebuild_index
>>         doc['product'],
>>     KeyError: 'product'
>>
>> Following it, I found out that the cause of the problem is related to an
>> attempt to log a debug message with the statement:
>>
>>                             self.log.debug(
>>                                 "Indexing document %s:%s/%s" % (
>>                                     doc['product'],
>>                                     doc['type'],
>>                                     doc['id'],
>>                                 )
>>                             )
>>
>> It appears that doc['product'] does not exist as a named key for the
>> dictionary doc for at least one document.
>>
>> I didn't had time to create a proper fix so, as a workaround, I removed
>> the statement and the "bhsearch rebuild" command started to work as
>> expected.
>>
>
> Hi Fabio, Thank you for investigating and provided a detailed description
> of the problem. We will put a fix in place.
>
>
>> I would like to know how can I create a BH account in the project's page
>> to report other issues I found in the current version.
>>
>
> You may register an account here:
> http://issues.apache.org/bloodhound/register

Reply via email to