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] #817

Closed
tomvannostrand opened this issue Nov 21, 2023 · 5 comments
Closed

[BUG] #817

tomvannostrand opened this issue Nov 21, 2023 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers untriaged

Comments

@tomvannostrand
Copy link

tomvannostrand commented Nov 21, 2023

Describe the bug

Trying to use a Google Webhook for a notification fails. Using other webhooks like Discord and https://webhook.site/ for example work fine.

To Reproduce
Steps to reproduce the behavior:

  1. Create a google chat webhook. Copy the link.
  2. In the OpenSearch GUI, Go to 'Notifications'
  3. Click on 'Channels'
  4. Add a notification and paste in your webhook
  5. Click test
  6. See error

Expected behavior
A notification pops up in google chat

OpenSearch Version
2.9, 2.11

Dashboards Version
2.9, 2.11

Plugins

None

Error message

[status_exception] {"event_status_list": [{"config_id":"N7QfGosBxj32RX8UNdMY","config_type":"webhook","config_name":"google webhooks are broken but heres mine","email_recipient_status":[],"delivery_status":{"status_code":"500","status_text":"Failed to send webhook message Failed: {\n "error": {\n "code": 400,\n "message": "Invalid JSON payload received. Unexpected token.\nTest message content\n^",\n "status": "INVALID_ARGUMENT"\n }\n}\n"}}]}

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: N/A
  • Browser and version: Chrome, but this is a UI bug not a browser bug.

Additional context

I'm using a webhook generated in google chat. For instance my host was: chat.googleapis.com

I've tried fiddling with manual webhook settings to no avail. It seems that whatever format OIpenSearch is sending to google, Google doesn't like it as it doesn't somehow conform to their formatting.
Because OpenSearch can send to other webhooks, just not google's but other things can send to google webhooks just fine, I believe the problem should be fixed within OpenSearch. Perhaps all webhook notifications could be modified to some lowest common denominator formatting, or perhaps in the manual settings, there could be a "and fix formatting to conform to google" button, or at least a way to manually modify whatever is breaking.

@tomvannostrand tomvannostrand added bug Something isn't working untriaged labels Nov 21, 2023
@wbeckler wbeckler transferred this issue from opensearch-project/OpenSearch-Dashboards Nov 21, 2023
@SuZhou-Joe
Copy link
Member

This looks more like the payload format check between notification and google chat. Transfer to notification repo.

@zhichao-aws
Copy link
Member

Hi @tomvannostrand , can you give a sample curl request to use the google webhook? For example: curl -H 'Content-Type: application/json' -d '{"text": "Hello World"}' . I want to make sure the json structure is consistent with our custom webhook.

@SuZhou-Joe SuZhou-Joe transferred this issue from opensearch-project/dashboards-notifications Nov 23, 2023
@SuZhou-Joe SuZhou-Joe added the good first issue Good for newcomers label Nov 23, 2023
@Hailong-am
Copy link
Collaborator

@tomvannostrand you can choose slack as notification type and input google webhook endpoint, they share same json schema.

@tomvannostrand
Copy link
Author

Sure enough! Picking "Slack" instead of "Custom Webhook" allows me to use a google webhook.
Suggest renaming these to "Standard Webhook" and "Custom webhook that you can't customize enough to work with google because customization options are too limited"

@tomvannostrand
Copy link
Author

Thank you @Hailong-am and @zhichao-aws. I've closed this but the problem remains that "Slack" should be renamed.

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

No branches or pull requests

4 participants