# \[ERROR\] Cannot race. Error in race control (Could not register track plugin at /Path/To/My/Track)

**URL:** <https://discuss.elastic.co/t/error-cannot-race-error-in-race-control-could-not-register-track-plugin-at-path-to-my-track/282155>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [August 22, 2021, 6:39am UTC](https://discuss.elastic.co/t/error-cannot-race-error-in-race-control-could-not-register-track-plugin-at-path-to-my-track/282155 "2021-08-22T06:39:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingswan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kingswan/32/139263_2.png) [@kingswan](https://discuss.elastic.co/u/kingswan)\
**Post date:** [August 22, 2021, 6:39am UTC](https://discuss.elastic.co/t/error-cannot-race-error-in-race-control-could-not-register-track-plugin-at-path-to-my-track/282155/1 "2021-08-22T06:39:27Z")

</div>

Hi, I am a new comer of rally.  
I created a customized track trademark\_multi, before I created track.py file, it worked well.  
After I created track.py for vary parameter, it cannot work again.

Here are the files I created:

_ **track.json:** _

```auto
{% import "rally.helpers" as rally with context %}
{
  "version": 2,
  "description": "Tracker-generated track for trademark_multi",
  "indices": [
    {
      "name": "trademark_multi",
      "body": "trademark_multi.json",
      "types": ["doc"]
    }
  ],
  "corpora": [
    {
      "name": "trademark_multi",
      "documents": [
        {
          "source-file": "trademark_multi-documents.json",
          "document-count": 155836,
          "uncompressed-bytes": 4008659147
        }
      ]
    }
  ],
  "operations": [
    {{ rally.collect(parts="operations/*.json") }}
  ],
  "challenges": [
    {{ rally.collect(parts="challenges/*.json") }}
  ]
}

```

**track.py:**

```auto
import random
import os
import csv

class QueryParamSource:
    # We need to stick to the param source API
    # noinspection PyUnusedLocal
    def __init__ (self, track, params, **kwargs):
        self._params = params
        self.infinite = True
        # here we read the queries data file into arrays which we'll then later use randomly.
        self.features = []
        # be predictably random. The seed has been chosen by a fair dice roll. ;)
        random.seed(4)
        cwd = os.path.dirname( __file__ )
        with open(os.path.join(cwd, "q_750.csv"), "r") as ins:
            csvreader = csv.reader(ins)
            for row in csvreader:
                self.features.append(row)

    # We need to stick to the param source API
    # noinspection PyUnusedLocal
    def partition(self, partition_index, total_partitions):
        return self

class NestedQueryParamSource(QueryParamSource):
    def params(self):
        result = {
            "body": {
                "query": {
                  "match_all": {}
                }
            },
            "index": None,
            "type": None
        }
        if "cache" in self._params:
            result["cache"] = self._params["cache"]

        return result

    def register(registry):
        registry.register_param_source("nested-query-source", NestedQueryParamSource)

```

**trademark\_multi.json:**

```auto
{
    "mappings": {
        "doc": {
            "_all": {
                "enabled": false
            },
            "properties": {
                "nested_image_vec": {
                    "properties": {
                        "image_vec": {
                            "bundle": 4,
                            "cmps_type": "N/A",
                            "data_type": "float16",
                            "dim": 2048,
                            "hash": 500,
                            "type": "gw_vector"
                        }
                    },
                    "type": "nested"
                }
            }
        }
    },
    "settings": {
        "index": {
            "number_of_replicas": "{{number_of_replicas | default(0)}}",
            "number_of_shards": "{{number_of_shards | default(5)}}"
        }
    }
}

```

And the Error from rally.log:

```auto
Traceback (most recent call last):

   File "/Users/Chester/Library/Python/3.8/lib/python/site-packages/esrally/track/loader.py", line 1062, in load
     root_module.register(self)

 AttributeError: module 'trademark_multi.track' has no attribute 'register'

 2021-08-22 06:19:05,320 ActorAddr-(T|:60558)/PID:44737 esrally.track.loader ERROR Cannot load track [trademark_multi]
 Traceback (most recent call last):

   File "/Users/Chester/Library/Python/3.8/lib/python/site-packages/esrally/track/loader.py", line 1062, in load
     root_module.register(self)

 AttributeError: module 'trademark_multi.track' has no attribute 'register'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):

   File "/Users/Chester/Library/Python/3.8/lib/python/site-packages/esrally/track/loader.py", line 197, in _load_single_track
     has_plugins = load_track_plugins(cfg, track_name, register_track_processor=tpr.register_track_processor)

   File "/Users/Chester/Library/Python/3.8/lib/python/site-packages/esrally/track/loader.py", line 235, in load_track_plugins
     plugin_reader.load()

   File "/Users/Chester/Library/Python/3.8/lib/python/site-packages/esrally/track/loader.py", line 1066, in load
     raise exceptions.SystemSetupError(msg)

 esrally.exceptions.SystemSetupError: Could not register track plugin at [/Users/Chester/Chester/Code/tools/rally-es/track/trademark_multi]

```

Please give some advice, thank you so much for the help.

Just tell me when need more information.

Best,  
Chester

---

<div class="post-metadata">

**Author:** ![kingswan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kingswan/32/139263_2.png) [@kingswan](https://discuss.elastic.co/u/kingswan)\
**Post date:** [August 22, 2021, 11:21am UTC](https://discuss.elastic.co/t/error-cannot-race-error-in-race-control-could-not-register-track-plugin-at-path-to-my-track/282155/2 "2021-08-22T11:21:47Z")

</div>

Solved, the register function in track.py got one more space, so that it can not be recognized.  
Sorry for the tiny typo mistake

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 19, 2021, 11:22am UTC](https://discuss.elastic.co/t/error-cannot-race-error-in-race-control-could-not-register-track-plugin-at-path-to-my-track/282155/3 "2021-09-19T11:22:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
