2023-07-12 06:35:27,969 -not-actor-/PID:59902 esrally.rally ERROR A fatal error occurred while running subcommand [add].
Traceback (most recent call last):
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 107, in guarded
return target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/grzegorz/Documents/src/elastic/rally/.venv/lib/python3.11/site-packages/elasticsearch/_sync/client/utils.py", line 395, in wrapped
raise ValueError(
ValueError: Couldn't merge 'body' with other parameters as it wasn't a mapping. Instead of using 'body' use individual API parameters
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/rally.py", line 1100, in dispatch_sub_command
dispatch_add(cfg)
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/rally.py", line 865, in dispatch_add
metrics.add_annotation(cfg)
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 1305, in add_annotation
race_store(cfg).add_annotation()
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 1655, in add_annotation
return self.es_store.add_annotation()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 1777, in add_annotation
self.client.create_index(index="rally-annotations", body=body)
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 71, in create_index
return self.guarded(self._client.indices.create, index=index, body=body, ignore=400)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/grzegorz/Documents/src/elastic/rally/esrally/metrics.py", line 165, in guarded
except elasticsearch.helpers.BulkIndexError as e:
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'elasticsearch' has no attribute 'helpers'
Therefore the problem is not only the missing index object in annotations-template.json which is what https://github.com/elastic/rally/issues/1746 suggests but also upgraded Python Elasticsearch client is more strict when evaluating body parameter in index create method.
This PR addresses the problem by aligning rally-annotations index creation handling with other indices, i.e. by using rally-annotations index template. This simplicity comes at a cost of slightly "wasteful" configuration if users decided to increase datastore.number_of_shards setting (rally-annotations is tiny).
Addresses https://github.com/elastic/rally/issues/1746.
The following naive fix reveals more problems:
Output:
Stack trace:
Therefore the problem is not only the missing
index
object inannotations-template.json
which is what https://github.com/elastic/rally/issues/1746 suggests but also upgraded Python Elasticsearch client is more strict when evaluatingbody
parameter in indexcreate
method.This PR addresses the problem by aligning
rally-annotations
index creation handling with other indices, i.e. by usingrally-annotations
index template. This simplicity comes at a cost of slightly "wasteful" configuration if users decided to increasedatastore.number_of_shards
setting (rally-annotations
is tiny).I've tested the change in staging environment: