-
Notifications
You must be signed in to change notification settings - Fork 343
Closed
Labels
bugSomething isn't workingSomething isn't workinguntriagedRequire the attention of the repository maintainers and may need to be prioritizedRequire the attention of the repository maintainers and may need to be prioritized
Description
What is the bug?
OpenSearch provide support for _render operation which helps to validate stored template, attached reference documents below.
- OpenSearch Doc : https://opensearch.org/docs/latest/api-reference/search-template/#save-and-execute-search-templates
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinguntriagedRequire the attention of the repository maintainers and may need to be prioritizedRequire the attention of the repository maintainers and may need to be prioritized
