slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.64k stars 1.13k forks source link

Slack app unresponsive every few days, connection from slack to backend sevice lost #1101

Open preethi-d opened 2 years ago

preethi-d commented 2 years ago

What happened

Every few days, the bot does not respond to any messages. I need to restart the backend service each time, then it works for a few days and then randomly stops responding once again.

Expected behavior

Bot stays responsive, since disconnections are supposed to be handles automatically by rtm.ManageConnection(). This was the behaviour previously, but suddenly having this issue.

Steps to reproduce

reproducible code

    token := os.Getenv("SLACK_TOKEN")
    api := slack.New(token)
    rtm := api.NewRTM()

    go rtm.ManageConnection()

manifest.yaml

Versions

kanata2 commented 2 years ago

Please give me some more details. Do you have any related logs, etc?

preethi-d commented 2 years ago

The logs we have basically shows incoming messages and responses from our bot, nothing about disconnection.

But when the bot is unresponsive, we can see that the messages sent to the bot do not appear in the logs, but the backend service status shows that it is still running. Hence we thought it could be the connection from slack to backend through rtm that is dropping.

preethi-d commented 2 years ago

https://github.com/slackapi/node-slack-sdk/issues/53 my issue sounds similar to this which was with an difference node slack package.

Is there a possibility that the websocket connection is dropping silently every now and then? Sometimes it a few days sometimes it happens even within a few hours. I thought the ManageConnection() method would handle it.

preethi-d commented 1 year ago

Hi @kanata2 do you have any updates regarding this, would really appreciate any help. thank you!