SonarQube doesn't send notification to Discord webhook - sonarqube

I want notification on my discord app after completing every scan in sonarqube. I have tried to configured my discord webhook URL in sonarqube webhook option but it getting 400 error code after scanning the code and not sending notification.
Steps i tried :
Created webhook URL from my discord chennel.
Configured that webhook URL in sonarqube > Administration > Configuration > Webhooks.
Run code scan So that it send notification to configured webhook.
But i am getting below error.
Error :
Last delivery of Spidey Bot
Response: 400
Duration: 186ms
Payload: .....
Discord webohook screenshot attached
SonarQube Error screenshot attached

It turns out, request body format which SonarQube sends to Discord is not acceptable. It leads to bad request error. Below is logged response from Discord,
{
"message": "Cannot send an empty message",
"code": 50006
}
To successfully post the message it must be in the specific format documented https://discordapp.com/developers/docs/resources/webhook#execute-webhook
The solution to this could be a mediatory URL which parses the request body and hits Discord Webhook with excepted body params.

Related

Sumologic sending alerts to SLACK

I tried to send alerts from Sumologic to Slack. But when I test the connection, it always failed and return 400 http code. I used the connection type as Webhook
When test the connection, it should pass
If you are using WebHook and testing the connection, you must use a valid payload. If you don't provide a valid payload, the connection test will not succeed.
You can use the connection type as SLACK over WebHook. Still, you are using a webhook URL.
This link shows how to integrate Sumologic with Slack.
https://www.youtube.com/watch?v=qEz8dcp9SgI

ms teams : response action

We are trying to automate in MS teams that will :
Parse json
HTTP Post to API
Get HTTP Response
post comment to the chat using adaptive card.
We created a BOT using power automate, and we created a flow using :
for selected message
parse JSON
HTTP Post to API
Post comment to the chat. using adaptive card
But when we add "response" in power automate using below flow :
for selected message
parse JSON
HTTP Post to API
Response
Parse JSON body (parse body from Response).
Post comment to the chat. using adaptive card
Upon saving, we are getting this error :
Flow save failed with code 'WorkflowUnsupportedSplitOnTriggerForResponseAction' and message 'The workflow with 'Response' action type should not have triggers with 'splitOn' property defined: 'manual'.'.
Please advise the correct flow to rectify above issue ?
Moving from comment's section :
This is by design. You can only add the response flow step after the request action. The response for the trigger is available as properties. Please refer to this thread for a similar issue.
https://powerusers.microsoft.com/t5/Building-Flows/unable-to-use-a-response-action/td-p/378804

Zabbix timing out when sending Slack notification, but alerts are still send

I have a question regarding the Slack Webhooks for Zabbix. I've configured Zabbix to send Slack messages when a trigger of any kind is triggered. However the alerts are send, but zabbix does not recognize that the messages have been send, as seen in the pictures below:
Slack Alerts
Slack Problem
The Error messages state: Slack notification failed : Error: cannot get URL: Timeout was reached
Resolved Message: Slack notification failed : channel_not_found
I've followed this tutorial for the Slack intergration.
My configuration is as follows:
Actions,
Zabbix Admin user Media
on Zabbix 4.4.7
Hopefully someone can help me with this!
if you use HTTPProxy parameter, modify script as follows:
function getPermalink(channelId, messageTimestamp, httpProxy) {
var req = new CurlHttpRequest();
if (typeof httpProxy === 'string' && httpProxy.trim() !== '') {
req.SetProxy(httpProxy);
}
and
result.tags.__message_link = getPermalink(resp.channel, resp.ts, params.HTTPProxy);

ngrok with DialogFlow for webhook debugging won't work

Last year, I was able to use ngrok to debug a webhook on api.ai (now called DialogFlow) by rerouting a public URL to a port on localhost.
Now, it simply won't work. I get the message "Error: Failed to parse webhook JSON response: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $."
The ngrok session shows "301 Moved Permanently" when DialogFlow executes the webhook, but the app is never reached.
Dialogflow treats responses besides a "200 ok" as a possible error. Using ngrok still works, but you should point directly to the URL of the webhook rather than the URL of something that will redirect to the webhook.

How to customize error message sent to an end-user when bot's endpoint is unavailable?

If a user sends message to a bot while it's endpoint is unavailable or failed processing the message, the user receives an error message from Bot Connector, which seems like that:
POST to {SomeArbitraryBot} failed: POST to the bot's endpoint failed with HTTP status 502
or
POST to {SomeArbitraryBot} failed: A task was canceled.
etc.
Is there a way to customize logic of sending error message or to suppress it at all in such a case?
UPDATE
I posted a corresponding issue at Bot Builder GitHub repository.

Resources