Botkit: Reconnects

Created on 11 Jul 2017  路  2Comments  路  Source: howdyai/botkit

Sometimes (however same time) all connections brake and not recover long time

Bot managed about 4000 teams.

  1. Connections for all teams were broken first
    2017-07-11T18:42:58+0000 Error: Stale RTM connection, closing RTM
    2017-07-11T18:42:58+0000 The RTM closed for https://xxx.slack.com/
    ...
  2. Then BotKit trying to reconnect
    2017-07-11T18:43:10+0000 * BOT ID: xxx ...reconnect attempt #1 of 5 being made after 1000ms
    2017-07-11T18:43:10+0000 *
    API CALL: https://slack.com/api/rtm.connect
    ...
  3. attempting connect
    2017-07-11T18:45:23+0000 ** BOT ID: xxx ...attempting to connect to RTM!
    ...
  4. unsuccessful attempt
    2017-07-11T18:45:44+0000 RTM websocket opened
    2017-07-11T18:45:44+0000 Connected to team T0SCFXXXX (https://xxx.slack.com/)
    2017-07-11T18:45:44+0000 RTM close event: 1006
    2017-07-11T18:45:44+0000 The RTM closed for https://xxx.slack.com/
    2017-07-11T18:45:44+0000 Abnormal websocket close event, attempting to reconnect
    ...

During 10-30 minutes and more the App can not establish the connections, and trying many to connect and produce the above errors.

I have this problem every work day about 8:00 am UTC and sometimes.

Is there a trouble in many numbers of teams? Or 4000 teams is normal for BotKit?

BotKit 0.5.4

Slack-related help wanted

All 2 comments

First of all, you might want to try and upgrade your version of Botkit, as we recently added some RTM websocket fixes that may improve this.

The fact that it occurs regular on a schedule points maybe to API side service management, and if you have as many bots as you do, you might want to take a look at your reconnect logic so you can avoid being rate limited by too many connections trying to access the Slack API at once on the reconnect.

Discussions on the best way to do this is probably beyond a Github issue, you should post a question in our #botkit channel in our public slack, and it can be discussed in more depth over there:
https://community.botkit.ai/

Thanks peterswimm!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seriousssam picture seriousssam  路  3Comments

abinashmohanty picture abinashmohanty  路  4Comments

iworkforthem picture iworkforthem  路  3Comments

fieldcorbett picture fieldcorbett  路  4Comments

HannanShaik picture HannanShaik  路  3Comments