IndexMissingException с использованием Bonsai Elasticsearch с Heroku и Django
Окружение: Я использую Django==1.5.4 с Python 2.7.2, развертывание на Heroku. Я использую Haystack с Elastic Search. На Heroku я использую дополнение Bonsai Elastic Search.
Проблема: когда я запускаю команду rebuild_index, я сталкиваюсь с "Ошибка тайм-аута чтения" при уничтожении индекса и "IndexMissingException" при попытке создать индексы. Вывод журнала таков:
> heroku run python manage.py rebuild_index
Running `python manage.py rebuild_index` attached to terminal... up, run.1762
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
Failed to clear Elasticsearch index: Non-OK response returned (404): u'IndexMissingException[[msdc] missing]'
All documents removed.
Indexing 195 schools
ERROR:root:Error updating schools using default
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 221, in handle_label
self.update_backend(label, using)
File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 267, in update_backend
do_update(backend, index, qs, start, end, total, self.verbosity)
File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 89, in do_update
backend.update(index, current_qs)
File "/app/.heroku/python/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 183, in update
self.conn.bulk_index(self.index_name, 'modelresult', prepped_docs, id_field=ID)
File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 96, in decorate
return func(*args, query_params=query_params, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 387, in bulk_index
query_params=query_params)
File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 254, in send_request
self._raise_exception(resp, prepped_response)
File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 268, in _raise_exception
raise error_class(response.status_code, error_message)
ElasticHttpNotFoundError: (404, u'IndexMissingException[[msdc] missing]')
ElasticHttpNotFoundError: (404, u'IndexMissingException[[msdc] missing]')
Проверка. Я явно создал индекс, который я проверял, пытаясь воссоздать его и выполнив шаги теста:
> curl -X POST http://index@box.us-east-1.bonsai.io/msdc
{"error":"Index already exists.","status":400}%
> curl -X POST http://index@boc.us-east-1.bonsai.io/msdc/test -d '{"title":"hello, world"}'
{"ok":true,"_index":"msdc","_type":"test","_id":"9q8t4m0sTgy6JeGkueL54Q","_version":1}%
> curl -X POST http://index@box.us-east-1.bonsai.io/msdc/_search -d '{}'
{"took":2,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"msdc","_type":"test","_id":"9q8t4m0sTgy6JeGkueL54Q","_score":1.0, "_source" : {"title":"hello, world"}}]}}%
Я довольно новичок в Elasticsearch и Heroku, поэтому я могу пропустить важный шаг. Любая помощь в устранении этой ошибки будет принята с благодарностью!