elastic / elastic/support-diagnostics

Use `expand_wildcards` to limit bad API responses

Open
#595 0 comments 0 reactions 0 assignees View on GitHub
Innovation Hub
Dominant language
Java
Stars
304
Forks
175
PR merge metrics
No merged PRs in 30d

Description

Certain API calls will fail if there are closed indices in the cluster, such as `_nodes/stats`. When there is a closed index it will respond with:

```
Bad Request. Rejected
{
"error" : {
"root_cause" : [
{
"type" : "index_closed_exception",
"reason" : "closed",
"index_uuid" : "LEF6dp1xTC2dkNCEMRtUUQ",
"index" : "syslog"
}
],
"type" : "index_closed_exception",
"reason" : "closed",
"index_uuid" : "LEF6dp1xTC2dkNCEMRtUUQ",
"index" : "syslog"
},
"status" : 400
}
```

The multi-target syntax allows adding `?expand_wildcards=open` as far back as 6.8:
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/multi-index.html

With additional `?expand_wildcards=open,hidden` options in 7.x:
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/multi-index.html

If we add this to the API calls we can hopefully prevent parsing failures when trying to run the diagnostic through the analyzer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.