KongZ / graylog-plugin-slack-notification

Graylog Slack Plugin
Apache License 2.0
9 stars 4 forks source link

Unexpected HTTP response status 400 #21

Closed franciscocpg closed 3 years ago

franciscocpg commented 3 years ago

I'm using the version 3.3.4 of this plugin with Graylog 3.3.8+e223f85 and I'm getting the error below.

Any ideas?

org.graylog.scheduler.JobExecutionException: Failed permanently to execute notification, giving up - <6036841e156df315c1c75c50/Suits ES has index read-only/slack-notification-v1>
    at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:156) ~[graylog.jar:?]
    at org.graylog.scheduler.JobExecutionEngine.executeJob(JobExecutionEngine.java:166) ~[graylog.jar:?]
    at org.graylog.scheduler.JobExecutionEngine.lambda$handleTrigger$2(JobExecutionEngine.java:144) ~[graylog.jar:?]
    at com.codahale.metrics.Timer.time(Timer.java:137) ~[graylog.jar:?]
    at org.graylog.scheduler.JobExecutionEngine.handleTrigger(JobExecutionEngine.java:144) ~[graylog.jar:?]
    at org.graylog.scheduler.JobExecutionEngine.lambda$execute$0(JobExecutionEngine.java:119) ~[graylog.jar:?]
    at org.graylog.scheduler.worker.JobWorkerPool.lambda$execute$0(JobWorkerPool.java:110) ~[graylog.jar:?]
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:181) [graylog.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
    at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
Caused by: org.graylog.events.notifications.PermanentEventNotificationException: Could not send message to Slack.
    at co.omise.graylog.plugins.slack.SlackNotification.execute(SlackNotification.java:64) ~[?:?]
    at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]
    ... 11 more
Caused by: java.lang.RuntimeException: Could not send message to Slack.
    at co.omise.graylog.plugins.slack.SlackNotification.send(SlackNotification.java:146) ~[?:?]
    at co.omise.graylog.plugins.slack.SlackNotification.execute(SlackNotification.java:58) ~[?:?]
    at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]
    ... 11 more
Caused by: co.omise.graylog.plugins.slack.SlackClient$SlackClientException: Unexpected HTTP response status 400
    at co.omise.graylog.plugins.slack.SlackClient.send(SlackClient.java:129) ~[?:?]
    at co.omise.graylog.plugins.slack.SlackNotification.send(SlackNotification.java:144) ~[?:?]
    at co.omise.graylog.plugins.slack.SlackNotification.execute(SlackNotification.java:58) ~[?:?]
    at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]
    ... 11 more
KongZ commented 3 years ago

The public could not read an event from Graylog. From the error message Suits ES has index read-only I think something wrong with ES index

franciscocpg commented 3 years ago

Hello @KongZ.

Suits ES has index read-only is the event's name that triggers the notification.

The public could not read an event from Graylog

I didn't understand this statement.

KongZ commented 3 years ago

Sorry, i was mean. The plugin cloud not read an event from Graylog

But after check the code. It seems that it had some problem with Slack API e.g. a message payload contains some characters with is not acceptable by Slack. The webhook address in invalid. Or a target username is invalid.

franciscocpg commented 3 years ago

Fixed using graylog 4.0.6 and version 4.0.1 of this plugin.