python-slack-sdk icon indicating copy to clipboard operation
python-slack-sdk copied to clipboard

Getting none response from slack for large workspace

Open codingmaths opened this issue 7 years ago • 5 comments

Description

I am getting below error , when I try to post something in my slack channel, where slackclient is catching no channel exist for existing channel.

What type of issue is this? (place an x in one of the [ ])

  • [X ] bug
  • [ ] enhancement (feature request)
  • [ ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [ x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [ x] I've read and agree to the Code of Conduct.
  • [ x] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: 1.3.1

python version: python 3.7

OS version(s): Mac

Steps to reproduce:

  1. use errbot to connect large slack workspace, using rtm_connect instead of rtm_start
  2. try to chat with slack app using slack channel
  3. https://github.com/errbotio/errbot

Expected result:

As per documentation, I should get response of hello. when I try to connect

Actual result:

Traceback (most recent call last): File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 419, in _dispatch_slack_message event_handler(message) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 516, in _message_event_handler msg.frm = SlackRoomOccupant(self.sc, user, event['channel'], bot=self) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 195, in init self._room = SlackRoom(channelid=channelid, bot=bot) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 1042, in init self.name = bot.channelid_to_channelname(channelid) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 553, in channelid_to_channelname raise RoomDoesNotExistError(f'No channel with ID {id} exists.') errbot.backends.base.RoomDoesNotExistError: No channel with ID CHDRY5 exists.

What actually happened

Attachments:

Traceback (most recent call last): File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 419, in _dispatch_slack_message event_handler(message) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 516, in _message_event_handler msg.frm = SlackRoomOccupant(self.sc, user, event['channel'], bot=self) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 195, in init self._room = SlackRoom(channelid=channelid, bot=bot) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 1042, in init self.name = bot.channelid_to_channelname(channelid) File "/Users/s0m02l2/Git/lazypanda/errbot/.errbot-ve/lib/python3.7/site-packages/errbot/backends/slack.py", line 553, in channelid_to_channelname raise RoomDoesNotExistError(f'No channel with ID {id} exists.') errbot.backends.base.RoomDoesNotExistError: No channel with ID CHDRY5 exists.

codingmaths avatar Apr 15 '19 09:04 codingmaths

Hey @codingmaths,

I've been looking into this and it looks like this may be an issue with the Errbot package and its not waiting for the connection to finish before attempting to grab the channel ID. It does seem similar to the issue you posted in https://github.com/skoczen/will/issues/409 so I'd suggest checking with the team at https://github.com/errbotio/errbot to see if they can check further. Our Channel ID does look like its in the right format, just a few characters short.

Have you used our RTM client on its own without the Errbot library to see if it still occurs?

lavabyrd avatar Apr 16 '19 20:04 lavabyrd

@splinterific I realised the issue, it's due to rtm.connect which is not responding with channel details, that's why I am getting this error.

Also my further observation:

I am trying to connect errbot/opsdroid/will chatbot with our slack workspace. But I am getting same error with all the chatbots . when I tried same code and chatbot with smaller slack workspace, it’s working as expected. With more troubleshoot I got to know it’s some kind of issue with large slack workspace , when they use rtm.start , since my chatbot also needs the channel related details I can’t use rtm.connect here.

with my experience I am able to authenticate app with slack but after that I am not getting any response from slack app. Instead I am getting none.

Please refer below log for same:

DEBUG errbot.bootstrap Start serving commands from the slack backend. 23:22:12 INFO errbot.backends.slack Verifying authentication token 23:22:12 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): slack.com:443 `23:22:13 DEBUG urllib3.connectionpool https://slack.com:443 "POST /api/auth.test HTTP/1.1" 200 146. ## successfully authenticated

23:22:13 DEBUG errbot.backends.slack Token accepted 23:22:13 INFO errbot.backends.slack Connecting to Slack real-time-messaging API 23:22:13 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): slack.com:443 23:22:35 DEBUG urllib3.connectionpool https://slack.com:443 "POST /api/rtm.start HTTP/1.1" 200 None. ## Getting none response

23:22:48 DEBUG root RTM connected

`

Let me know if you need any other detail from me.

codingmaths avatar Apr 17 '19 03:04 codingmaths

@codingmaths , if you do use the Python-Slackclient on its own (without a wrapped library like Errbot/willbot), do you still see the same issue using rtm.connect()?

lavabyrd avatar Apr 18 '19 17:04 lavabyrd

Its been a while since we heard back so I'm going to close this out @codingmaths , if you do continue to have issues without using that library, do let us know!

lavabyrd avatar May 30 '19 10:05 lavabyrd

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

feiyang233 avatar Feb 10 '21 03:02 feiyang233