What is the bug?
OpenSearch provide support for _render operation which helps to validate stored template, attached reference documents below.
But for OS_2.11 FGAC enabled domains _render operation is not working as it is failing with the following exception
{
"type": "security_exception",
"reason": "Unexpected exception indices:data/read/search/template"
}
While analyzing further observed that the issue might be related to recent PR
How can one reproduce the bug?
Steps to reproduce the behavior:
- Create FGAC enabled OS_2.11 domain
- Then perform the following operations on the domain
- First save search template as a script
POST _scripts/play_search_template
{
"script": {
"lang": "mustache",
"source": {
"from": "{{from}}{{^from}}0{{/from}}",
"size": "{{size}}{{^size}}10{{/size}}",
"query": {
"match": {
"play_name": ""
}
}
},
"params": {
"play_name": "Henry IV"
}
}
}
4.Then try to perform render operation to validate saved template
POST _render/template
{
"id": "play_search_template",
"params": {
"play_name": "Henry IV"
}
}
- See error as below
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "Unexpected exception indices:data/read/search/template"
}
],
"type": "security_exception",
"reason": "Unexpected exception indices:data/read/search/template"
},
"status": 500
}
What is the expected behavior?
render operation should have worked and the output for the above reproduction steps should be as follow instead of exception
{
"template_output": {
"from": "0",
"size": "10",
"query": {
"match": {
"play_name": "Henry IV"
}
}
}
}
What is your host/environment?
- OpenSearch version OS_2.11
Do you have any screenshots?

What is the bug?
OpenSearch provide support for
_renderoperation which helps to validate stored template, attached reference documents below.But for OS_2.11 FGAC enabled domains
_renderoperation is not working as it is failing with the following exceptionWhile analyzing further observed that the issue might be related to recent PR
How can one reproduce the bug?
Steps to reproduce the behavior:
4.Then try to perform render operation to validate saved template
What is the expected behavior?
render operation should have worked and the output for the above reproduction steps should be as follow instead of exception
What is your host/environment?
Do you have any screenshots?
