Hi,

I have recently upgraded my Reviewboard from 2.5.8 to 3.0.15. The 
transition went smoothly :)

I decided to move from Whoosh to Elasticsearch. I noted it must be the 2.x 
branch and so installed elasticsearch 2.4.6.1 via yum and elasticsearch 
2.4.1 via pip.

When I do 

rb-site manage [site] rebuild_index

I see a few 404/400.

Removing all documents from your index because you said so.
INFO:elasticsearch:DELETE http://127.0.0.1:9200/reviewboard [status:200 
request:0.107s]
No handlers could be found for logger "elasticsearch.trace"
All documents removed.
Indexing 199 users
WARNING:elasticsearch:GET /reviewboard/_mapping [status:404 request:0.006s]
INFO:elasticsearch:PUT http://127.0.0.1:9200/reviewboard [status:200 
request:0.195s]
WARNING:elasticsearch:PUT /reviewboard/_mapping/modelresult [status:400 
request:0.027s]

I ignored this and the remainder of the rebuild_index completes.

However, when I attempt to do a search I get the following error ..

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", 
line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", 
line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/reviewboard/search/views.py", line 
101, in dispatch
    return self.form_valid(form)
  File "/usr/lib/python2.7/site-packages/haystack/generic_views.py", line 80
, in form_valid
    'object_list': self.queryset
  File "/usr/lib/python2.7/site-packages/reviewboard/search/views.py", line 
120, in get_context_data
    **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/list.py", 
line 112, in get_context_data
    paginator, page, queryset, is_paginated = self.paginate_queryset(
queryset, page_size)
  File "/usr/lib/python2.7/site-packages/django/views/generic/list.py", 
line 56, in paginate_queryset
    page = paginator.page(page_number)
  File "/usr/lib/python2.7/site-packages/django/core/paginator.py", line 50, 
in page
    number = self.validate_number(number)
  File "/usr/lib/python2.7/site-packages/django/core/paginator.py", line 39, 
in validate_number
    if number > self.num_pages:
  File "/usr/lib/python2.7/site-packages/django/core/paginator.py", line 86, 
in _get_num_pages
    if self.count == 0 and not self.allow_empty_first_page:
  File "/usr/lib/python2.7/site-packages/django/core/paginator.py", line 72, 
in _get_count
    self._count = self.object_list.count()
  File "/usr/lib/python2.7/site-packages/haystack/query.py", line 487, in 
count
    return len(self)
  File "/usr/lib/python2.7/site-packages/haystack/query.py", line 96, in 
__len__
    self._result_count = self.query.get_count()
  File "/usr/lib/python2.7/site-packages/haystack/backends/__init__.py", 
line 626, in get_count
    self.run()
  File "/usr/lib/python2.7/site-packages/haystack/backends/__init__.py", 
line 563, in run
    results = self.backend.search(final_query, **search_kwargs)
  File "/usr/lib/python2.7/site-packages/haystack/backends/__init__.py", 
line 35, in wrapper
    return func(obj, query_string, *args, **kwargs)
  File 
"/usr/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py"
, line 497, in search
    search_kwargs = self.build_search_kwargs(query_string, **kwargs)
  File 
"/usr/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py"
, line 297, in build_search_kwargs
    for field, direction in sort_by:
ValueError: too many values to unpack

The reviewboard.log shows the elasticsearch for the PUT modelresult, which 
causes the above error

2019-09-06 10:05:00,652 - DEBUG -  - elasticsearch - > {"modelresult": {
"_boost": {"name": "boost", "null_value": 1.0}, "properties": {"commit_id": 
{"type": "string", "analyzer": "edgengram_analyzer"}, "last_updated": {
"type": "date"}, "file": {"type": "string", "analyzer": "snowball"}, 
"is_profile_private": {"type": "boolean"}, "text": {"type": "string", 
"analyzer": "snowball"}, "target_users": {"type": "string", "analyzer": 
"snowball"}, "private_repository_id": {"type": "long"}, "private": {"type": 
"boolean"}, "django_ct": {"include_in_all": false, "index": "not_analyzed", 
"type": "string"}, "full_name": {"type": "string", "analyzer": "snowball"}, 
"django_id": {"include_in_all": false, "index": "not_analyzed", "type": 
"string"}, "review_request_id": {"type": "long"}, "author": {"type": 
"string", "analyzer": "snowball"}, "testing_done": {"type": "string", 
"analyzer": "snowball"}, "email": {"type": "string", "analyzer": "snowball"
}, "username": {"type": "string", "analyzer": "snowball"}, "description": {
"type": "string", "analyzer": "snowball"}, "groups": {"index": 
"not_analyzed", "type": "string"}, "bug": {"type": "string", "analyzer": 
"snowball"}, "url": {"type": "string", "analyzer": "snowball"}, "summary": {
"type": "string", "analyzer": "snowball"}, "private_target_groups": {"type": 
"string", "analyzer": "snowball"}, "local_sites": {"type": "string", 
"analyzer": "snowball"}}}}



Note the '_boost' portion at the start of the JSON.

I believe Reviewboard does not expect that and so errors with 'too many 
values to unpack'.

I attempted to rebuild_index again, except this time I monitored 
elasticsearch.log. I see the following error, mentioning '_boost' again

[2019-09-06 10:01:48,600][DEBUG][action.admin.indices.mapping.put] [
Chameleon] failed to put mappings on indices [[reviewboard]], type [
modelresult]
MapperParsingException[Root mapping definition has unsupported parameters:  
[_boost : {name=boost, null_value=1.0}]]
    at org.elasticsearch.index.mapper.DocumentMapperParser.
checkNoRemainingFields(DocumentMapperParser.java:171)
    at org.elasticsearch.index.mapper.DocumentMapperParser.parse(
DocumentMapperParser.java:159)
    at org.elasticsearch.index.mapper.DocumentMapperParser.parse(
DocumentMapperParser.java:99)
    at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java
:549)
    at org.elasticsearch.cluster.metadata.
MetaDataMappingService$PutMappingExecutor.applyRequest(
MetaDataMappingService.java:257)
    at org.elasticsearch.cluster.metadata.
MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.
java:230)
    at org.elasticsearch.cluster.service.InternalClusterService.
runTasksForExecutor(InternalClusterService.java:480)
    at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.
run(InternalClusterService.java:784)
    at org.elasticsearch.common.util.concurrent.
PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(
PrioritizedEsThreadPoolExecutor.java:231)
    at org.elasticsearch.common.util.concurrent.
PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(
PrioritizedEsThreadPoolExecutor.java:194)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:624)
    at java.lang.Thread.run(Thread.java:748)

I did a bit of digging and the issue seems to be django-haystack. I have 
version 2.4.1 installed, which is the highest I can go before 5.0.0, which 
is unsupported by Reviewboard.

This link [https://www.oipapio.com/question-420019] seems to suggest an 
incompatability between haystack 2.x and elasticsearch 2.x because of the 
_boost portion.

What am I doing wrong? I have the latest elasticsearch (2.4.6.1 via yum and 
2.4.1 via pip) and the latest django-haystack (2.4.1)

Thanks in advance,
Michael


-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard-issues/5fa53b76-3b3f-4578-bda2-59c7b8d09680%40googlegroups.com.

Reply via email to