- Affected version
- 2.2.0
XFES does not reliably extract the reason in all cases, and instead returns "all shards failed".
Extracting the
Code:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: {...}",
"index_uuid": "eGF-QPilSjmnXSIyciAi8A",
"index": "index"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "index",
"node": "KSAcwz8sRCefPVJo0wK7Xg",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: {...}",
"index_uuid": "eGF-QPilSjmnXSIyciAi8A",
"index": "index",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Can't parse boolean value [0], expected [true] or [false]"
}
}
}
]
},
"status": 400
}
Extracting the
reason.type
/reason.caused_by.type
/reason.caused_by.reason
from the failed_shards
gives the actual failure reason. (probably safe to just grab from the first failed shard.
Last edited: