New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gracefully handle Slack websocket closing #1449
Comments
Are you using plain bot scope or the new granular scopes? |
I'm using the old, plain bot scope. How would that effect the gracefulness of this error? 😕 |
I need to understand your setup fully so that I can attempt to replicate the issue you're having. |
I was able to reproduce the issue. I'll dig into the code to see what can be done to handle this case cleanly. |
@nzlosh: I tested it out, but it didn't change anything. 😞 It does however look like the changes are made for the (It was my understanding that the |
You're quite right, I mistook the RTM stream errors to be related to the |
OK. Thanks for taking the time to look into this! |
@torgeirl I also got this issue, because reaching the maximum duration of a RTM web socket connection (8 hours), slack close the RTM connection. Do you have any update for this one? Thanks |
Would you mind trying this backend https://github.com/nzlosh/err-backend-slackv3 and letting me know if you encounter the problem. |
I using errbotv5.2 and slackclientv1.3.1, because our slack is huge, so rtm.start is naturally more difficult to use with Enterprise Grid and other large workspaces. We often got the rtm_read error, after troubleshooting, we find out the bottleneck is CPU, old instance type is t3a.medium, which is often crash at errbot restart and need to wait for 6 mins to pull information from slack. After the change to c5.large, I test 3 times restart just now, no crash anymore, faster to pull information from slack, only 4 mins |
I have been receiving the same error message in 2 different bots. (One running locally and one running in a k8s cluster) should i be using Slack_rtm instead? |
@drahamim The websocket closing issue was resolved on the slackv3 if you'd like to try it out. |
Updated the opening post with my current environment and included the I do hope this issue either can be fixed for for the |
Can confirm the connection re-establishing itself is graceful handled as of Errbot v6.2.0 using the
The graceful handling is immediately followed by some errors however, but that seems to be caused by the
|
I am...
I am running...
Errbot version: 6.1.8
OS version: Debian (
python:3.9-slim
container)Python version: 3.9
Using a virtual environment: no (using Docker instead)
Backend:
Slack
Issue description
The Slack RTM websocket closing (Slack goodbye event) causes a Python error. This Python error should be handled more gracefully (ie using some try/except), and instead log a warning when the websocket is closed and reopened.
Steps to reproduce
Run a Slack bot using the master branch, and leave it running for a few hours. After 3-12hr you should get a Python error due to the Slack RTM websocket closed.
Workaround
Switch to the
slackv3
backend.Additional info
The text was updated successfully, but these errors were encountered: