Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] _render Operation is not working in OS_2.11 #3861

Closed
niravpi opened this issue Dec 18, 2023 · 2 comments
Closed

[BUG] _render Operation is not working in OS_2.11 #3861

niravpi opened this issue Dec 18, 2023 · 2 comments
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized

Comments

@niravpi
Copy link

niravpi commented Dec 18, 2023

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:

  1. Create FGAC enabled OS_2.11 domain
  2. Then perform the following operations on the domain
  3. 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"
  }
}
  1. 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?
Screenshot 2023-12-18 at 3 51 05 PM

@niravpi niravpi added bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized labels Dec 18, 2023
@expani
Copy link

expani commented Dec 18, 2023

Thanks @niravpi for reporting the issue.
I believe it's already being tracked at #3672

@cwperks
Copy link
Member

cwperks commented Dec 18, 2023

Closing as duplicate of #3672

@cwperks cwperks closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized
Projects
None yet
Development

No branches or pull requests

3 participants