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][OpenSearch Plugins] script_exception Runtime Error When Previewing Trigger Condition in Per Cluster Metrics Monitor #8622

Closed
getsolaris opened this issue Oct 17, 2024 · 4 comments
Labels
bug Something isn't working untriaged

Comments

@getsolaris
Copy link

Describe the bug
When creating a Per Cluster Metrics Monitor in the OpenSearch Plugins tab, selecting "Nodes stats" as the request type and clicking on "Preview condition response" after setting the trigger results in a script_exception runtime error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to OpenSearch Dashboards.
  2. Navigate to the "Plugins" tab and click on "Create Monitor."
  3. Select "Per Cluster Metrics Monitor" as the monitor type.
  4. For the query request type, choose "Nodes stats."
  5. Click on "Preview query" to check the query response.
  6. Set a trigger and leave the "Trigger condition" as default.
  7. Click on "Preview condition response."
  8. See the script_exception runtime error.

Expected behavior
The trigger condition preview should return a valid response without throwing a script_exception runtime error.

OpenSearch Version
OpenSearch 2.15 (OpenSearch_2_15_R20240904-P2)

Dashboards Version
v 2.15.0

Plugins
Please list all plugins currently enabled.

Screenshots
Screenshot 2024-10-17 at 6 01 57 PM

  • Trigger condition
ctx.results[0].nodes.NODE_ID.jvm.mem.heap_used_percent > 60
  • Trigger condition response
{
  "type" : "script_exception",
  "reason" : "runtime error",
  "script_stack" : [
    "ctx.results[0].nodes.NODE_ID.jvm.mem.heap_used_percent > 60",
    "                            ^---- HERE"
  ],
  "script" : "ctx.results[0].nodes.NODE_ID.jvm.mem.heap_used_percent > 60",
  "lang" : "painless",
  "position" : {
    "offset" : 28,
    "start" : 0,
    "end" : 59
  },
  "caused_by" : {
    "type" : "null_pointer_exception",
    "reason" : "Cannot invoke \"Object.getClass()\" because \"callArgs[0]\" is null"
  }
}

Host/Environment (please complete the following information):

  • OS: Mac OS
  • Browser and version: Version 129.0.6668.100 (Official Build) (arm64)

Additional context
This error only occurs when trying to preview the trigger condition. Query preview works as expected, and the error appears during the preview of the trigger condition response.

@getsolaris getsolaris added bug Something isn't working untriaged labels Oct 17, 2024
@zhyuanqi
Copy link
Collaborator

This belongs to alerting plugin. Reroute it to alerting.

@zhyuanqi
Copy link
Collaborator

@opensearch-project/plugins could you please transfer to the right repo?

@getsolaris
Copy link
Author

@zhyuanqi thank you

@getsolaris
Copy link
Author

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
Projects
None yet
Development

No branches or pull requests

2 participants