which it is the cause of this error?? I'm using django1.9 and django-haystack == 2.4.1
(venv)daniel@daniel22:~/prototipos/venv/ejemplo/exp$ python manage.py update_index
Indexing 2 documents
/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/fields.py:137: RemovedInDjango110Warning: render() must be called with a dict, not a Context.
return t.render(Context({'object': obj}))
ERROR:root:Error updating art using default
Traceback (most recent call last):
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 188, in handle_label
self.update_backend(label, using)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 233, in update_backend
do_update(backend, index, qs, start, end, total, verbosity=self.verbosity, commit=self.commit)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 96, in do_update
backend.update(index, current_qs, commit=commit)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 193, in update
bulk(self.conn, prepped_docs, index=self.index_name, doc_type='modelresult')
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 188, in bulk
for ok, item in streaming_bulk(client, actions, **kwargs):
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 160, in streaming_bulk
for result in _process_bulk_chunk(client, bulk_actions, raise_on_exception, raise_on_error, **kwargs):
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 132, in _process_bulk_chunk
raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)
BulkIndexError: (u'2 document(s) failed to index.', [{u'index': {u'_type': u'modelresult', u'_id': u'art.document.1', u'ok': True, u'_version': 4, u'_index': u'haystack'}}, {u'index': {u'_type': u'modelresult', u'_id': u'art.document.2', u'ok': True, u'_version': 4, u'_index': u'haystack'}}])
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 183, in handle
return super(Command, self).handle(*items, **options)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 548, in handle
label_output = self.handle_label(label, **options)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 188, in handle_label
self.update_backend(label, using)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 233, in update_backend
do_update(backend, index, qs, start, end, total, verbosity=self.verbosity, commit=self.commit)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 96, in do_update
backend.update(index, current_qs, commit=commit)
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 193, in update
bulk(self.conn, prepped_docs, index=self.index_name, doc_type='modelresult')
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 188, in bulk
for ok, item in streaming_bulk(client, actions, **kwargs):
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 160, in streaming_bulk
for result in _process_bulk_chunk(client, bulk_actions, raise_on_exception, raise_on_error, **kwargs):
File "/home/daniel/prototipos/venv/local/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 132, in _process_bulk_chunk
raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)
elasticsearch.helpers.BulkIndexError: (u'2 document(s) failed to index.', [{u'index': {u'_type': u'modelresult', u'_id': u'art.document.1', u'ok': True, u'_version': 4, u'_index': u'haystack'}}, {u'index': {u'_type': u'modelresult', u'_id': u'art.document.2', u'ok': True, u'_version': 4, u'_index': u'haystack'}}])
EDIT: you can use the latest version from github v2.5 which has these changes or make them yourself. Ultimately it comes down to piss poor error handling in the models.py file where they catch an exception without logging and continue on with model=None
It seems haystack 2.4 is not Django 1.9 compatible. I fixed this by deleting the context function and returning the dict only i.e:
To do this you will need to directly edit the source of the site-package - if you are using Virtual Env, and you should be, then just go env/lib/python*.*/site-packages/haystack
Other issues I came across:
-