Skip to content

index_out_of_bounds_exception and null_pointer_exception in nested aggregates (global -> terms -> top_hits) #22321

@Chakrygin

Description

@Chakrygin

Elasticsearch version: 5.1.1

Plugins installed: -

JVM version: jre1.8.0_111

OS version: Windows 7, Ubuntu 16

Description of the problem including expected versus actual behavior:

index_out_of_bounds_exception in nested aggregates (global -> terms -> top_hits)

Steps to reproduce:

  1. Test data:
POST _bulk
{"index":{"_index":"test","_type":"test","_id":"21206357"}}
{"id":21206357,"name":"AEG PW 5570 FA Inox, 5 in 1 напольные весы","content":"AEG PW 5570 FA Inox, 5 in 1 напольные весы,Напольные весы,AEG","brand_id":24566662,"brand_name":"AEG"}
{"index":{"_index":"test","_type":"test","_id":"21206358"}}
{"id":21206358,"name":"AEG PW 5571 FA Glas, 6 in 1 напольные весы","content":"AEG PW 5571 FA Glas, 6 in 1 напольные весы,Напольные весы,AEG","brand_id":24566662,"brand_name":"AEG"}
{"index":{"_index":"test","_type":"test","_id":"21206499"}}
{"id":21206499,"name":"Clatronic PW 3368, Glas напольные весы","content":"Clatronic PW 3368, Glas напольные весы,Напольные весы,Clatronic","brand_id":26303064,"brand_name":"Clatronic"}
{"index":{"_index":"test","_type":"test","_id":"21206500"}}
{"id":21206500,"name":"Clatronic PW 3369, Black Glas напольные весы","content":"Clatronic PW 3369, Black Glas напольные весы,Напольные весы,Clatronic","brand_id":26303064,"brand_name":"Clatronic"}
{"index":{"_index":"test","_type":"test","_id":"21206501"}}
{"id":21206501,"name":"Clatronic PW 3370 напольные весы","content":"Clatronic PW 3370 напольные весы,Напольные весы,Clatronic","brand_id":26303064,"brand_name":"Clatronic"}
{"index":{"_index":"test","_type":"test","_id":"21891718"}}
{"id":21891718,"name":"Vitek VT-1983(BK) весы напольные","content":"Vitek VT-1983(BK) весы напольные,Напольные весы,Vitek,dbntr витэк витек мшеул","brand_id":26303458,"brand_name":"Vitek"}
{"index":{"_index":"test","_type":"test","_id":"22452029"}}
{"id":22452029,"name":"Vitek VT-1986, Green весы напольные","content":"Vitek VT-1986, Green весы напольные,Напольные весы,Vitek,dbntr витэк витек мшеул","brand_id":26303458,"brand_name":"Vitek"}
{"index":{"_index":"test","_type":"test","_id":"22453024"}}
{"id":22453024,"name":"Tefal PP1121 Classic Fashion Love напольные весы","content":"Tefal PP1121 Classic Fashion Love напольные весы,Напольные весы,Tefal,Тефаль, Тефал","brand_id":18819636,"brand_name":"Tefal"}
{"index":{"_index":"test","_type":"test","_id":"33677014"}}
{"id":33677014,"name":"Вытяжка классическая ELIKOR Бельведер 60П-650-П3Г бежевый/дуб неокр","content":"Вытяжка классическая ELIKOR Бельведер 60П-650-П3Г бежевый/дуб неокр,Вытяжка,Каминная,Пристенная,Elikor,ELIKOR","brand_id":24595342,"brand_name":"Elikor"}
{"index":{"_index":"test","_type":"test","_id":"35037591"}}
{"id":35037591,"name":"Lacroix для iPhone 5/5S Paseo Hard Black","content":"Lacroix для iPhone 5/5S Paseo Hard Black,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037593"}}
{"id":35037593,"name":"Lacroix для iPhone 5/5S Paseo Hard Gold","content":"Lacroix для iPhone 5/5S Paseo Hard Gold,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037595"}}
{"id":35037595,"name":"Lacroix для iPhone 5/5S Suiting Folio Black","content":"Lacroix для iPhone 5/5S Suiting Folio Black,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037599"}}
{"id":35037599,"name":"Lacroix для iPhone 6/6S Butterfly Hard Pink","content":"Lacroix для iPhone 6/6S Butterfly Hard Pink,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037601"}}
{"id":35037601,"name":"Lacroix для iPhone 6/6S Paseo Hard Gold","content":"Lacroix для iPhone 6/6S Paseo Hard Gold,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037619"}}
{"id":35037619,"name":"Lacroix для iPhone 6+/6S+ Butterfly Hard Black","content":"Lacroix для iPhone 6+/6S+ Butterfly Hard Black,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037621"}}
{"id":35037621,"name":"Lacroix для iPhone 6+/6S+Butterfly Hard White","content":"Lacroix для iPhone 6+/6S+Butterfly Hard White,Чехол для сотового телефона,Чехол,ChristianLacroix","brand_id":35037587,"brand_name":"ChristianLacroix"}
{"index":{"_index":"test","_type":"test","_id":"35037629"}}
{"id":35037629,"name":"Kenzo для iPhone 5/5S Big K Folio Kaki","content":"Kenzo для iPhone 5/5S Big K Folio Kaki,Чехол для сотового телефона,Чехол,Kenzo,кензо кинзо cenzo лутящ rtypj","brand_id":18571406,"brand_name":"Kenzo"}
{"index":{"_index":"test","_type":"test","_id":"35037635"}}
{"id":35037635,"name":"Kenzo для iPhone 5/5S Chick Flip Blue","content":"Kenzo для iPhone 5/5S Chick Flip Blue,Чехол для сотового телефона,Чехол,Kenzo,кензо кинзо cenzo лутящ rtypj","brand_id":18571406,"brand_name":"Kenzo"}
{"index":{"_index":"test","_type":"test","_id":"35037649"}}
{"id":35037649,"name":"Kenzo для iPhone 5/5S Leo Pack (folio+covers)","content":"Kenzo для iPhone 5/5S Leo Pack (folio+covers),Чехол для сотового телефона,Чехол,Kenzo,кензо кинзо cenzo лутящ rtypj","brand_id":18571406,"brand_name":"Kenzo"}
{"index":{"_index":"test","_type":"test","_id":"35037661"}}
{"id":35037661,"name":"Kenzo для iPhone 5/5S/5SE Tiger Hard Violine","content":"Kenzo для iPhone 5/5S/5SE Tiger Hard Violine,Чехол для сотового телефона,Чехол,Kenzo,кензо кинзо cenzo лутящ rtypj","brand_id":18571406,"brand_name":"Kenzo"}
  1. Search request:
POST /test/test/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "multi_match": {
            "query": "apple iphone",
            "fields": [
              "name",
              "content"
            ]
          }
        }
      ],
      "filter": [
        {
          "term": {
            "brand_id": {
              "value": 26303000
            }
          }
        }
      ]
    }
  },
  "size": 0,
  "aggs": {
    "global": {
      "global": {},
      "aggs": {
        "brand": {
          "terms": {
            "field": "brand_id"
          },
          "aggs": {
            "name": {
              "top_hits": {
                "size": 1
              }
            }
          }
        }
      }
    }
  }
}
  1. Error:
{
  "error": {
    "root_cause": [
      {
        "type": "index_out_of_bounds_exception",
        "reason": null
      },
      {
        "type": "null_pointer_exception",
        "reason": null
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "test",
        "node": "LgkZnevWR1CcVVbV9ybVPA",
        "reason": {
          "type": "index_out_of_bounds_exception",
          "reason": null
        }
      },
      {
        "shard": 3,
        "index": "test",
        "node": "LgkZnevWR1CcVVbV9ybVPA",
        "reason": {
          "type": "null_pointer_exception",
          "reason": null
        }
      }
    ],
    "caused_by": {
      "type": "index_out_of_bounds_exception",
      "reason": null
    }
  },
  "status": 500
}

Description of the problem including expected versus actual behavior:

null_pointer_exception in nested aggregates (global -> terms -> top_hits)

Steps to reproduce:

  1. Test data:
POST _bulk
{"index":{"_index":"test","_type":"test","_id":"21206358"}}
{"id":21206358,"name":"AEG PW 5571 FA Glas, 6 in 1 напольные весы","content":"AEG PW 5571 FA Glas, 6 in 1 напольные весы,Напольные весы,AEG","brand_id":24566662,"brand_name":"AEG"}
{"index":{"_index":"test","_type":"test","_id":"21206500"}}
{"id":21206500,"name":"Clatronic PW 3369, Black Glas напольные весы","content":"Clatronic PW 3369, Black Glas напольные весы,Напольные весы,Clatronic","brand_id":26303064,"brand_name":"Clatronic"}
{"index":{"_index":"test","_type":"test","_id":"21891718"}}
{"id":21891718,"name":"Vitek VT-1983(BK) весы напольные","content":"Vitek VT-1983(BK) весы напольные,Напольные весы,Vitek,dbntr витэк витек мшеул","brand_id":26303458,"brand_name":"Vitek"}
{"index":{"_index":"test","_type":"test","_id":"22453024"}}
{"id":22453024,"name":"Tefal PP1121 Classic Fashion Love напольные весы","content":"Tefal PP1121 Classic Fashion Love напольные весы,Напольные весы,Tefal,Тефаль, Тефал","brand_id":18819636,"brand_name":"Tefal"}
{"index":{"_index":"test","_type":"test","_id":"33677014"}}
{"id":33677014,"name":"Вытяжка классическая ELIKOR Бельведер 60П-650-П3Г бежевый/дуб неокр","content":"Вытяжка классическая ELIKOR Бельведер 60П-650-П3Г бежевый/дуб неокр,Вытяжка,Каминная,Пристенная,Elikor,ELIKOR","brand_id":24595342,"brand_name":"Elikor"}
  1. Search request:

(see above)

  1. Error:
{
  "error": {
    "root_cause": [
      {
        "type": "null_pointer_exception",
        "reason": null
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "test",
        "node": "LgkZnevWR1CcVVbV9ybVPA",
        "reason": {
          "type": "null_pointer_exception",
          "reason": null
        }
      }
    ],
    "caused_by": {
      "type": "null_pointer_exception",
      "reason": null
    }
  },
  "status": 500
}

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions