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] - Can't select Channel notification #1550

Open
ggt opened this issue May 21, 2024 · 7 comments
Open

[BUG] - Can't select Channel notification #1550

ggt opened this issue May 21, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@ggt
Copy link

ggt commented May 21, 2024

After a lot of updates, i have an issue with the latest 2.14.0, i can't select notification i get a 400 error.
Channels are visible in channel tab but not in the alerting/monitor item.

I give you some screenshots to explain the issue.
image

image

SOLUTION:
it works when i rewrite url from https://127.0.0.1:5601/api/notifications/get_configs?from_index=0&max_items=5000&sort_field=name&sort_order=asc -> https://127.0.0.1:5601/api/notifications/get_configs?from_index=0&max_items=10&query=&config_type=slack&config_type=email&config_type=chime&config_type=microsoft_teams&config_type=webhook&config_type=sns&sort_field=name&sort_order=asc

(it seems you forgot some parameters!)

image

Have a nice day!

@ggt ggt added bug Something isn't working untriaged labels May 21, 2024
@huyaboo
Copy link
Member

huyaboo commented May 21, 2024

@opensearch-project/admin Could you please move this to the Alerting repo?

@huyaboo huyaboo removed the untriaged label May 21, 2024
@bbarani bbarani transferred this issue from opensearch-project/OpenSearch-Dashboards May 21, 2024
@mjk-141
Copy link

mjk-141 commented May 23, 2024

Hello.
I'm also stuck with the same issue, so could you explain how to change the URL from https://127.0.0.1:5601/api/notifications/get_configs?from_index=0&max_items=5000&sort_field=name&sort_order=asc
to :
https://127.0.0.1:5601/api/notifications/get_configs?from_index=0&max_items=10&query=&config_type=slack&config_type=email&config_type=chime&config_type=microsoft_teams&config_type=webhook&config_type=sns&sort_field=name&sort_order=asc

@dblock
Copy link
Member

dblock commented Jun 24, 2024

Maybe someone wants to contribute a fix for this?

Catch All Triage - 1 2 3 4 5 6

@dblock dblock removed the untriaged label Jun 24, 2024
@shotawatanaberdworks
Copy link

Hello, this bug is very critical and our client cannot update the existing monitors or even create new ones. We are using v2.14.0 as it's the latest version from Aiven service. I tried changing the URL explained above, but still have the same issues.

When I hit this URL,
/api/notifications/get_configs?from_index=0&max_items=5000&sort_field=name&sort_order=asc
It returns
{"statusCode":400,"error":"Bad Request","message":"[request query.config_type]: expected at least one defined value but got [undefined]"}

This one
/api/notifications/get_configs?from_index=0&max_items=10&query=&config_type=slack&config_type=email&config_type=chime&config_type=microsoft_teams&config_type=webhook&config_type=sns&sort_field=name&sort_order=asc
returns
{"statusCode":400,"error":"Bad Request","message":"[request query.dataSourceId]: expected value of type [string] but got [undefined]"}

I think 'query=' has to have a value but I don't know what to input. I want to know what is the exact URL which works.

Thank you.

@adstak
Copy link

adstak commented Jul 23, 2024

Bit of an fyi for this thread. I have managed to replicate this bug on 2.14.0 and also replicated the fix using requestly in firefox as described above so can confirm the local temp fix at least works and lets you configure the monitors as expected.

I have been looking at this issue for a couple of hours and I believe the issue might lie with alerting-dashboards-plugin and not the alterting repo seen here, however I could be wrong as haven't had time to setup a dev env yet and play with this.

From my investigation I beleive this looks to be an issue of config_type within getChannelsQuery in public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js not containing the expected json object from the endpoint --> api/notifications/features

The expected json should be something like the following:

{"availableChannels":{"slack":"Slack","chime":"Chime","microsoft_teams":"Microsoft Teams","webhook":"Custom webhook","email":"Email","sns":"Amazon SNS"},"availableConfigTypes":["slack","chime","microsoft_teams","webhook","email","sns","ses_account","smtp_account","email_group"],"tooltipSupport":false}

So when getServerFeatures() is requested which runs the function of the same name inside --> public/services/NotificationService.ts it should return a key value pair object containg the channel keys and values but instead when configTypes is defined with object.keys for the value it isn't setting the array of strings correctly. This is my thoughts currently but again sorry as I don't have time currently to fully investigate it at this time.

Commits that could be related to this bug but haven't have enough time to test and don't have time frame of when bug started:

opensearch-project/alerting-dashboards-plugin@c239ded
opensearch-project/alerting-dashboards-plugin@1c7239f

Hopefully this helps someone start a trail as I wanted to just share where I got to before having to leave this bug for now but If the above looks likely at least related to the opensearch-project/alerting-dashboards-plugin repo then it might be best to move the issue there and have contributors there take a look.

I will come back to this issue in a month or so if no one comes up with a fix and take a more detailed look when I have more time, so fingers crossed a solution is found for this bug as its rather annoying

@maaaax
Copy link

maaaax commented Sep 18, 2024

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

7 participants