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] Destination drop-down list remains empty when disallowed destinations still exist #1043

Open
christiand93 opened this issue Aug 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@christiand93
Copy link

christiand93 commented Aug 5, 2024

What is the bug?

When creating or updating the trigger action for an alerting monitor in OpenSearch Dashboards, the list of available destinations remains empty, even though destinations have been configured. The issue occurs only when there is at least one destination remaining whose types has been removed from the allow list.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Switch to alerting and create a destination with type "email".
  2. Create a second destination with a different type, e.g, "slack".
  3. Remove "email" from the list of allowed destination types in the OpenSearch configuration:
     plugins.alerting.destination.allow_list: ["chime", "slack", "custom_webhook", "test_action"]
  4. Switch to alerting again and create a new monitor.
  5. Add a trigger and try to select a destination from the drop-down list. The list of destination remains empty although the "slack" destination should show up.

What is the expected behavior?
All destinations with an allowed type should appear when creating or updating a trigger action.

Versions

  • OpenSearch version: 1.3.16
  • OpenSearch Dashboards version: 1.3.16

Investigation
We have found a problem in the getDestinations method in ConfigureActions.js:
The destinations are filtered with the allowList in line 95, which is working fine. However, at the end of the method the following code fetches more destinations, if the total number reported by the API is not reached yet:

if (
destinationsResponse.totalDestinations &&
destinations.length < destinationsResponse.totalDestinations
) {
index += MAX_DESTINATIONS;
await getDestinations();
}

Unfortunately, the condition uses the already filtered list of destinations and not the number of destinations from the destinationsResponse. This means that if one or more destinations are filtered out previously, the method attempts to fetch more destinations. This eventually fails because index exceeds a certain limit (10,000 in our case).

@christiand93 christiand93 added bug Something isn't working untriaged labels Aug 5, 2024
@christiand93 christiand93 changed the title [BUG] Destination drop-down list remains empty when disabled destinations still exist [BUG] Destination drop-down list remains empty when disallowed destinations still exist Aug 5, 2024
@dblock dblock removed the untriaged label Aug 26, 2024
@dblock
Copy link
Member

dblock commented Aug 26, 2024

[Catch All Triage - 1, 2, 3, 4, 5]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants