You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Slack workflow webhook results in errors thrown in Grafana server code, even though Slack messages are sent successfully.
Example logs:
logger=ngalert.notifier.alertmanager org=1 t=2024-04-24T18:43:15.211109257Z level=error component=alertmanager orgID=1 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="slack/slack[0]: notify retry canceled due to unrecoverable error after 1 attempts: failed to send Slack message: unexpected empty response"
Slack message sent successfully:
Important note:
If running Grafana in HA mode, this results in alerts being sent multiple times, since HA peers think that their peers failed to send the notification, even though it was sent successfully.
What is expected to happen?
Webhook "200 ok" responses are gracefully handled without error.
Using Slack webhook contact point when running in HA mode results in only 1 notification sent.
Run a grafana server locally (e.g. docker run --rm -it -p "3000:3000" grafana/grafana-oss:10.4.1)
Create a Slack contact point and enter Slack webhook URL created in step 1
Set default notification policy to use Slack contact point
Create a new Alert with a threshold that causes it to always be firing (e.g. >-1)
Observe errors in Grafana server logs
Other Notes
I believe the problematic code is here, where a JSON object is always expected in the response. However from the Slack docs, it states that plaintext "ok" will be returned on success: https://api.slack.com/messaging/webhooks#handling_errors
in most cases you'll receive a "HTTP 200" response with a plain text ok indicating that your message posted successfully
The text was updated successfully, but these errors were encountered:
Can we get a copy of the slack config? Is there a proxy or other network service in between grafana and slack? We have failed to reproduce this with the steps above.
kylehounslow
changed the title
Slack webhook always results in "failed to send Slack message: unexpected empty response"
Slack workflow webhook always results in "failed to send Slack message: unexpected empty response"
May 7, 2024
@kylehounslow can you share more details about how you created the workflow? I am not familiar with this way of using Slack but if I have a way to reproduce it locally, I can fix the problem in the integration.
What is happening?
Using Slack workflow webhook results in errors thrown in Grafana server code, even though Slack messages are sent successfully.
Example logs:
Slack message sent successfully:
Important note:
If running Grafana in HA mode, this results in alerts being sent multiple times, since HA peers think that their peers failed to send the notification, even though it was sent successfully.
What is expected to happen?
Steps to reproduce
docker run --rm -it -p "3000:3000" grafana/grafana-oss:10.4.1
)>-1
)Other Notes
I believe the problematic code is here, where a JSON object is always expected in the response. However from the Slack docs, it states that plaintext "ok" will be returned on success: https://api.slack.com/messaging/webhooks#handling_errors
The text was updated successfully, but these errors were encountered: