botkube icon indicating copy to clipboard operation
botkube copied to clipboard

[BUG] Botkube failed to send webhook with error code of 400

Open canberkkoc opened this issue 3 years ago • 6 comments

Describe the bug I install bot kube with helm and take this error on pod logs "Error Posting Webhook: 400". I tried on other pods at the same cluster webhook is working.

To Reproduce

  1. Install botkube with helm like this command: helm install botkube --namespace botkube
    --set communications.webhook.enabled=true
    --set communications.webhook.url='xxxxxxxx'
    --set config.settings.clustername=xxxxxxxx
    infracloudio/botkube
  2. Check logs with kubectl command.

Expected behavior Send alert to my slack channel via webhook.

canberkkoc avatar Jun 16 '21 14:06 canberkkoc

@canberkkoc could you please let me know which platform you are using? Is it Slack/Teams webhook or some other platform.

PrasadG193 avatar Jul 21 '21 06:07 PrasadG193

Hello @PrasadG193 I use webhook for slack.

canberkkoc avatar Jul 21 '21 15:07 canberkkoc

@PrasadG193 : I too face the same issue. I am on EKS 1.21 - Slack Integration using Webhook. With debug enabled, I got the below error.:

ERRO[2021-08-30T20:15:23Z] Error Posting Webhook: 400
DEBU[2021-08-30T20:15:23Z] Event Not Sent to Webhook { v1/pods error Pod adapter-5dd48bf55d-82cqg sbx [Error: failed to start container "adapter": Error response from daemon: OCI runtime create failed: container_linux.go:364: creating new parent process caused: container_linux.go:2005: running lstat on namespace path "/proc/32621/ns/ipc" caused: lstat /proc/32621/ns/ipc: no such file or directory: unknown] error Failed  error v21-cluster  2021-08-30 20:15:23 +0000 UTC 1  false v1/pods [] []}

rangarb885 avatar Aug 30 '21 20:08 rangarb885

Hi, I am using webhook for Webex Teams and I too see the same error ( I am running Kops v1.18 and botkube-v0.12.2)

ERRO[2021-09-01T22:09:57Z] Error Posting Webhook: 400
DEBU[2021-09-01T22:09:57Z] Event Not Sent to Webhook { v1/pods error Pod test-nginx spice-stage [Error: ImagePullBackOff] error Failed error ipvkb-stva 2021-09-01 22:09:54 +0000 UTC 1 false v1/pods [] []} DEBU[2021-09-01T22:09:57Z] Event successfully sent to Webhook { v1/pods error Pod test-nginx spice-stage [Error: ImagePullBackOff] error Failed error ipvkb-stva 2021-09-01 22:09:54 +0000 UTC 1 false v1/pods [] []}

Sumankontham avatar Sep 01 '21 22:09 Sumankontham

Hi I got the same 400 error when using google chat web hook. I have used the following installation command

helm install --version v0.12.3 botkube --namespace botkube \ --set communications.webhook.enabled=true \ --set communications.webhook.url="https://chat.googleapis.com/v1/spaces/********" \ --set config.settings.clustername=docker-desktop-test\ --set image.repository=infracloudio/botkube \ --set image.tag=v0.12.3 \ infracloudio/botkube

muratkarakas avatar Oct 01 '21 06:10 muratkarakas

Hi, is there any fix?

ronaldo-barros avatar Feb 12 '22 18:02 ronaldo-barros

Hello everyone, This is not really an error for the webhook integration. Status code were returned directly from the target system, so in this case (status code 400 - "Bad request") the target system (Google Chat, Webex) indicated it couldn't handle the request. That means, you would need an adapter which converts the Botkube outgoing webhook payload to the one you want to integrate with.

This is how the payload is defined on Botkube side: https://github.com/kubeshop/botkube/blob/main/pkg/sink/webhook.go#L33

Hope that helps. Cheers!

pkosiec avatar Feb 20 '23 08:02 pkosiec