opendatateam / docker-udata

udata and plugins all-in-one Docker image
https://hub.docker.com/r/udata/udata/builds
MIT License
15 stars 12 forks source link

elasticsearch index_not_found_exception #210

Closed mdamien closed 4 years ago

mdamien commented 4 years ago

Le log:

udata_1          | POST /udata/_suggest [status:404 request:0.007s]
udata_1          | [2020-11-05 16:26:46,299] ERROR in app: Exception on /api/1/organizations/suggest/ [GET]
udata_1          | Traceback (most recent call last):
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1838, in full_dispatch_request
udata_1          |     rv = self.dispatch_request()
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1824, in dispatch_request
udata_1          |     return self.view_functions[rule.endpoint](**req.view_args)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/udata/api/__init__.py", line 135, in wrapper
udata_1          |     return func(*args, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper
udata_1          |     resp = resource(*args, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 88, in view
udata_1          |     return self.dispatch_request(*args, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
udata_1          |     resp = meth(*args, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/flask_restplus/marshalling.py", line 243, in wrapper
udata_1          |     resp = f(*args, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/udata/core/organization/api.py", line 338, in get
udata_1          |     for opt in search.suggest(args['q'], 'org_suggest', args['size'])
udata_1          |   File "/usr/local/lib/python3.7/site-packages/udata/search/__init__.py", line 268, in suggest
udata_1          |     result = s.execute_suggest().to_dict()
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch_dsl/search.py", line 643, in execute_suggest
udata_1          |     **self._params
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
udata_1          |     return func(*args, params=params, **kwargs)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 834, in suggest
udata_1          |     '_suggest'), params=params, body=body)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch/transport.py", line 327, in perform_request
udata_1          |     status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 110, in perform_request
udata_1          |     self._raise_error(response.status, raw_data)
udata_1          |   File "/usr/local/lib/python3.7/site-packages/elasticsearch/connection/base.py", line 114, in _raise_error
udata_1          |     raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
udata_1          | elasticsearch.exceptions.NotFoundError: TransportError(404, 'index_not_found_exception', 'no such index')

Dés que je tente une recherche, j'ai une erreur 500

abulte commented 4 years ago

Il faut probablement initialiser l'index, cf README docker run -it --rm udata/udata init

mdamien commented 4 years ago

Merci, c'est docker exec -it docker-udata_udata_1 ./entrypoint.sh init dans mon cas (avec docker-compose) mais c'est bien ca l'idée

EDIT: Also found docker-compose run --rm udata init to work, found it here: https://github.com/opendatateam/docker-udata/tree/master/samples/gouvfr