elastic / elastic/support-diagnostics
Use `expand_wildcards` to limit bad API responses
- 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
Assessment
This issue has not been assessed yet.