openannotation / annotator-store

A backend store for the Annotator
http://annotateit.org/
MIT License
177 stars 66 forks source link

Elasticsearch 1.3.x index creation #104

Closed tilgovi closed 9 years ago

tilgovi commented 10 years ago

Seeing these errors, which I'm guessing are due to an ES upgrade:

$ ./run.py 
2014-10-27 11:08:42 6498 annotator.elasticsearch [INFO] Creating index 'annotator'.
2014-10-27 11:08:42 6498 elasticsearch [WARNING] PUT /annotator [status:400 request:0.023s]
2014-10-27 11:08:42 6498 annotator.elasticsearch [CRITICAL] Failed to create an Elasticsearch index
Traceback (most recent call last):
  File "./run.py", line 98, in <module>
    main()
  File "./run.py", line 62, in main
    annotation.Annotation.create_all()
  File "/home/tilgovi/src/openannotation/annotator-store/annotator/elasticsearch.py", line 96, in create_all
    conn.indices.create(cls.es.index)
  File "build/bdist.linux-x86_64/egg/elasticsearch/client/utils.py", line 70, in _wrapped
  File "build/bdist.linux-x86_64/egg/elasticsearch/client/indices.py", line 94, in create
  File "build/bdist.linux-x86_64/egg/elasticsearch/transport.py", line 274, in perform_request
  File "build/bdist.linux-x86_64/egg/elasticsearch/connection/http_urllib3.py", line 55, in perform_request
  File "build/bdist.linux-x86_64/egg/elasticsearch/connection/base.py", line 83, in _raise_error
elasticsearch.exceptions.RequestError: TransportError(400, u'RemoteTransportException[[Straw Man][inet[/fe80:0:0:0:2677:3ff:fe17:e004%3:9300]][indices/create]]; nested: IndexAlreadyExistsException[[annotator] already exists]; ')

IndexAlreadyExistsException is no longer at the start of the error message, so the .startswith() check we do when we catch this error does not work.

tilgovi commented 9 years ago

Not sure what caused this. Doesn't seem to be happening now.