Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomElasticEngine doesn't index when editing an item #204

Open
yomguy opened this issue May 24, 2018 · 1 comment
Open

CustomElasticEngine doesn't index when editing an item #204

yomguy opened this issue May 24, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@yomguy
Copy link
Member

yomguy commented May 24, 2018

telemeta.util.backend.CustomElasticEngine is still buggy :

Traceback (most recent call last):

  File "/opt/miniconda/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)

  File "/srv/src/telemeta/telemeta/views/item.py", line 676, in dispatch
    return super(ItemEditView, self).dispatch(*args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/extra_views/advanced.py", line 151, in post
    return super(BaseUpdateWithInlinesView, self).post(request, *args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/extra_views/advanced.py", line 105, in post
    return self.forms_valid(form, inlines)

  File "/srv/src/telemeta/telemeta/views/item.py", line 643, in forms_valid
    item = form.save()

  File "/opt/miniconda/lib/python2.7/site-packages/django/forms/models.py", line 446, in save
    construct=False)

  File "/opt/miniconda/lib/python2.7/site-packages/django/forms/models.py", line 99, in save_instance
    instance.save()

  File "/srv/src/telemeta/telemeta/models/item.py", line 174, in save
    super(MediaItem, self).save(force_insert, force_update, *args, **kwargs)

  File "/srv/src/telemeta/telemeta/models/core.py", line 135, in save
    super(ModelCore, self).save(force_insert, force_update, *args, **kwargs)

  File "/opt/miniconda/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)

  File "/opt/miniconda/lib/python2.7/site-packages/django/db/models/base.py", line 582, in save_base
    update_fields=update_fields, raw=raw, using=using)

  File "/opt/miniconda/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 185, in send
    response = receiver(signal=self, sender=sender, **named)

  File "/srv/src/django-haystack/haystack/signals.py", line 52, in handle_save
    index.update_object(instance, using=using)

  File "/srv/src/django-haystack/haystack/indexes.py", line 282, in update_object
    backend.update(self, [instance])

  File "/srv/src/django-haystack/haystack/backends/elasticsearch_backend.py", line 193, in update
    bulk(self.conn, prepped_docs, index=self.index_name, doc_type='modelresult')

  File "/opt/miniconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 182, in bulk
    for ok, item in streaming_bulk(client, actions, **kwargs):

  File "/opt/miniconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 155, in streaming_bulk
    raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)

BulkIndexError: ('1 document(s) failed to index.', [{u'index': {u'status': 503, u'_type': u'modelresult', u'_id': u'telemeta.mediaitem.66441', u'error': u"UnavailableShardsException[[telemeta-crem][0] Primary shard is not active or isn't assigned to a known node. Timeout: [1m], request: org.elasticsearch.action.bulk.BulkShardRequest@29c3a63e]", u'_index': u'telemeta-crem'}}])

Workaround : use haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine instead

@yomguy yomguy added the bug label May 24, 2018
@yomguy yomguy added this to the 1.8 milestone May 24, 2018
@yomguy yomguy self-assigned this May 24, 2018
@yomguy
Copy link
Member Author

yomguy commented May 24, 2018

seems to be related to the last 1.X version of ElasticSearch. Please do python manage.py rebuild_index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant