Run custom tracks get type error

When I run custom tracks ,I got type error. I can't figure out, need help! Thanks!
esrally version: esrally 1.4.1
es version: 6.4.0

my custom track:

{% import "rally.helpers" as rally with context %}
{
  "version": 2,
  "description": "Tracker-generated track for nsh",
  "indices": [
    {
      "name": "xxxxxx",
      "body": "xxxxx.json",
      "types": ["doc"]
    },
    {
      "name": "xxxxx",
      "body": "xxxxxxx.json",
      "types": ["doc"]
    }
  ],
  "corpora": [
    {
      "name": "nsh",
      "documents": [
        {
          "target-index": "xxxxx",
          "source-file": "xxxxxxx.json.bz2",
          "document-count": 14960567,
          "compressed-bytes": 814346714,
          "uncompressed-bytes": 12138377222
        },
                {
          "target-index": "xxxxxxx",
          "source-file": "xxxxxxxxx.json.bz2",
          "document-count": 24000503,
          "compressed-bytes": 1296215463,
          "uncompressed-bytes": 19551041674
        }
      ]
    }
  ],
  "schedule": [
        {
          "operation": "delete-index"
        },
        {
          "operation": {
                "operation-type": "create-index",
                "settings": {{index_settings | default({}) | tojson}}
          }
        },
        {
          "operation": {
                "operation-type": "cluster-health",
                "index": "xxxxxxxxxx,xxxxxxxx",
                "request-params": {
                  "wait_for_status": "{{cluster_health | default('green')}}",
                  "wait_for_no_relocating_shards": "true"
                },
                "retry-until-success": true
          }
        },
        {
                "parallel":{
                  "tasks":[
                        {
                          "operation": {
                                "operation-type": "bulk",
                                "bulk-size": {{bulk_size | default(5000)}},
                                "ingest-percentage": {{ingest_percentage | default(100)}}
                          },
                          "clients": {{bulk_indexing_clients | default(8)}}
                        }
                  ]
                }
        }
  ]
}

my index:

{
    "mappings": {
        "doc": {
            "_all": {
                "enabled": false
            },
            "dynamic_templates": [
                {
                    "string_template": {
                        "mapping": {
                            "type": "keyword"
                        },
                        "match": "*",
                        "match_mapping_type": "string"
                    }
                }
            ],
            "properties": {
                "@timestamp": {
                    "type": "date"
                },
                "back": {
                    "type": "keyword"
                },
                "client_timestamp": {
                    "type": "long"
                },
                "collapse": {
                    "type": "keyword"
                },
                "collapse_times": {
                    "type": "long"
                },
                "mem_texture_scene": {
                    "type": "double"
                },
                "start": {
                    "type": "keyword"
                },
                "start_times": {
                    "type": "long"
                },
                "total_entity_count": {
                    "type": "integer"
                },
                "ts": {
                    "format": "yyyy-MM-dd HH:mm:ss",
                    "type": "date"
                },
                "used_total": {
                    "type": "integer"
                },
                "user_name": {
                    "type": "keyword"
                },
                "uuid": {
                    "type": "keyword"
                },
                "vendor": {
                    "type": "keyword"
                },
                "visible_entity_count": {
                    "type": "integer"
                }
            }
        }
    },
    "settings": {
        "index": {
            "codec": "best_compression",
            "number_of_replicas": "{{number_of_replicas | default(1)}}",
            "number_of_shards": "{{number_of_shards | default(3)}}",
            "refresh_interval": "60s",
            "unassigned": {
                "node_left": {
                    "delayed_timeout": "900m"
                }
            }
        }
    }
}

my documents:

{
  "_index": "xxxxxxxx",
  "_type": "doc",
  "_id": "1HddlncBhU7lsWQpjCIR",
  "_version": 1,
  "_score": null,
  "_source": {
    "is_normal": 1,
    "@timestamp": "2021-02-12T13:10:42.817+0000",
    "spname": "xxxxxxxx",
    "roley": "xxxxxxx",
    "osme": "xxxxxxx",
    "quit": "",
    "foreg": "",
    "collapse": "",
    "ts": "2021-02-12 21:10:29"
  },
  "fields": {
    "@timestamp": [
      "2021-02-12T13:10:42.817Z"
    ],
    "ts": [
      "2021-02-12T21:10:29.000Z"
    ]
  },
  "sort": [
    1613135442817
  ]
}

error log:
[ERROR] Cannot race. Error in load generator [0]
Cannot run task [bulk]: Request returned an error. Error type: transport, Description: action_request_validation_exception ({'error': {'root_cause': [{'type': 'action_request_validation_exception', 'reason': 'Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;'}], 'type': 'action_request_validation_exception', 'reason': 'Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;'}, 'status': 400})

es client node received requests:
image

image

I add this, then it works.

But the doc said this needn't, I think maybe the doc need to modify.

1 Like

Hi @GITnewfish,

Looks like you have two indices in your track.json "indices" section. Note the documentation you've highlighted says "if you have defined exactly one index"

Hope that helps, and please let us know if there is anything further.

Thanks,
Rick B

Thanks,my fault. All I see was "this index has exactly one type", ignored the words before "and".

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