chaoss / grimoirelab-elk

GNU General Public License v3.0
59 stars 120 forks source link

grimoire_elk.elk - ERROR - [git] Problem executing study enrich_areas_of_code:git, RequestError(400, 'search_phase_execution_exception', 'No mapping found for [metadata__timestamp] in order to sort on') #927

Closed Alanscut closed 4 years ago

Alanscut commented 4 years ago

run rimoirelab with docker-compoe, then the log of mordred:

2020-08-01 04:04:06,999 - grimoire_elk.elk - ERROR - [git] Problem executing study enrich_areas_of_code:git, RequestError(400, 'search_phase_execution_exception', 'No mapping found for [metadata__timestamp] in order to sort on')
2020-08-01 04:04:06,999 - sirmordred.task_manager - ERROR - [git] Exception in Task Manager RequestError(400, 'search_phase_execution_exception', 'No mapping found for [metadata__timestamp] in order to sort on')
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/sirmordred/task_manager.py", line 97, in run
    task.execute()
  File "/usr/local/lib/python3.5/dist-packages/sirmordred/task_enrich.py", line 436, in execute
    raise e
  File "/usr/local/lib/python3.5/dist-packages/sirmordred/task_enrich.py", line 426, in execute
    self.__studies(retention_time)
  File "/usr/local/lib/python3.5/dist-packages/sirmordred/task_enrich.py", line 339, in __studies
    do_studies(ocean_backend, enrich_backend, studies_args, retention_time=retention_time)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/elk.py", line 392, in do_studies
    raise e
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/elk.py", line 389, in do_studies
    study(ocean_backend, enrich_backend, **params)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/enriched/git.py", line 576, in enrich_areas_of_code
    areas_of_code(git_enrich=enrich_backend, in_conn=in_conn, out_conn=out_conn)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/enriched/study_ceres_aoc.py", line 230, in areas_of_code
    ndocs = aoc.analyze()
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/enriched/ceres_base.py", line 96, in analyze
    for item_block in self._in.read_block(size=self._block_size, from_date=from_date):
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/enriched/study_ceres_aoc.py", line 99, in read_block
    preserve_order=True):
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/helpers/__init__.py", line 364, in scan
    request_timeout=request_timeout, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/client/utils.py", line 76, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/client/__init__.py", line 660, in search
    doc_type, '_search'), params=params, body=body)
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/transport.py", line 318, in perform_request
    status, headers_response, data = connection.perform_request(method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/connection/http_requests.py", line 90, in perform_request
    self._raise_error(response.status_code, raw_data)
  File "/usr/local/lib/python3.5/dist-packages/elasticsearch/connection/base.py", line 125, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'No mapping found for [metadata__timestamp] in order to sort on')
zhquan commented 4 years ago

Hi @Alanscut,

The index git areas of code hasn't metadata__timestamp field. Remove the index and restart the Mordred container but make sure first that your git raw index has items.

The name of those indexes you can find it on your setup.cfg. i.e. git raw index is git_raw and git areas of code is git-aoc_enriched

[git]
raw_index = git_raw
enriched_index = git_enriched
latest-items = false
category = commit
studies = [enrich_areas_of_code:git]

[enrich_areas_of_code:git]
in_index = git_raw
out_index = git-aoc_enriched

Execute GET _cat/indices to know if there are items in your indexes.

I hope it helps you,

Best, Quan

Alanscut commented 4 years ago

Thanks, I removed all the indexs and restarted mordred container works.