outofcoffee / corebot

A bot to trigger Rundeck and Jenkins jobs from Slack.
72 stars 15 forks source link

SLACK_CHANNELS is set but channelName is null #59

Open moet78 opened 5 years ago

moet78 commented 5 years ago

Hit this error when starting corebot. I have specified SLACK_CHANNELS but it complains about null..

Is there some other thing that needs to be specified?

21:44:20.658 [main] ERROR com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl - caught exception in dispatchImpl
java.lang.IllegalStateException: channelName must not be null
        at com.gatehill.corebot.frontend.slack.chat.SlackSessionServiceImpl$connectedListeners$1.onEvent(SlackSessionServiceImpl.kt:45) ~[frontends-slack-1.3.2.Final.jar:?]
        at com.gatehill.corebot.frontend.slack.chat.SlackSessionServiceImpl$connectedListeners$1.onEvent(SlackSessionServiceImpl.kt:41) ~[frontends-slack-1.3.2.Final.jar:?]
        at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl$EventDispatcher.dispatchImpl(SlackWebSocketSessionImpl.java:246) [simple-slack-api-d3fe7de811.jar:?]
        at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl$EventDispatcher.dispatch(SlackWebSocketSessionImpl.java:209) [simple-slack-api-d3fe7de811.jar:?]
        at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.establishWebsocketConnection(SlackWebSocketSessionImpl.java:386) [simple-slack-api-d3fe7de811.jar:?]
        at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.connectImpl(SlackWebSocketSessionImpl.java:353) [simple-slack-api-d3fe7de811.jar:?]
        at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.connect(SlackWebSocketSessionImpl.java:294) [simple-slack-api-d3fe7de811.jar:?]
        at com.gatehill.corebot.frontend.slack.chat.SlackSessionServiceImpl$session$2.invoke(SlackSessionServiceImpl.kt:32) [frontends-slack-1.3.2.Final.jar:?]
        at com.gatehill.corebot.frontend.slack.chat.SlackSessionServiceImpl$session$2.invoke(SlackSessionServiceImpl.kt:20) [frontends-slack-1.3.2.Final.jar:?]
        at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130) [kotlin-stdlib-1.1.51.jar:1.1.51]
        at com.gatehill.corebot.frontend.slack.chat.SlackSessionServiceImpl.getSession(SlackSessionServiceImpl.kt) [frontends-slack-1.3.2.Final.jar:?]
        at com.gatehill.corebot.frontend.slack.chat.SlackChatServiceImpl.listenForEvents(SlackChatServiceImpl.kt:42) [frontends-slack-1.3.2.Final.jar:?]
        at com.gatehill.corebot.bot.Bot.start(Bot.kt:22) [bots-common-1.3.2.Final.jar:?]
        at com.gatehill.corebot.bot.MainKt.main(Main.kt:15) [bots-slack-deploy-1.3.2.Final.jar:?]

My compose file:

version: '3'

services:
  rundeck:
#    image: ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}
    build: .
    tty: true
    environment:
      <<env lists>>
    ports:
        - "4440:4440"
    expose:
        - "4440"
    volumes:
        - data:/home/rundeck/server/data
        - ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key

  corebot:
    build: corebot
    environment:
      SLACK_AUTH_TOKEN: "TOKEN"
      SLACK_CHANNELS: "channel1,channel2"
      RUNDECK_API_TOKEN: "API_TOKEN"
      RUNDECK_BASE_URL: "http://localhost:4440/"
      SYSTEM_CONFIG_FILE: "/opt/corebot/system_config.yml"

volumes:
  data:
orbiran88 commented 4 years ago

You can set SLACK_ENABLE_JOIN_MESSAGE to false to bypass this bug...

The actual bug is on the slack-simple-api project.

Corebot needs to replace slack-simple-api with https://github.com/seratch/jslack-maintenance-releases

outofcoffee commented 2 years ago

Thank you - raised #69 to look at replacing the library.