tshamz / brianwilliams

Read-only slack channels. Silence is golden.
MIT License
9 stars 11 forks source link

"** The RTM api just closed" #3

Open 0x5c opened 6 years ago

0x5c commented 6 years ago

Brianwilliams loose the connection to the slack workspace. It happens frequently, after a uptime of 1h to 7days. Sending commands to Brian does nothing, and he stops deleting messages from channels. The "Howdy!" page stays up.

info: ** No persistent storage method specified! Data may be lost when process shuts down.
info: ** Setting up custom handlers for processing Slack messages
info: ** Configuring app as a Slack App!
info: ** API CALL: https://slack.com/api/rtm.start
info: ** Starting webserver on port 80
info: ** Serving webhook endpoints for Slash commands and outgoing webhooks at: http://MY_HOST:80/slack/receive
info: ** Serving app landing page at : http://MY_HOST:80/
info: ** Serving login URL: http://MY_HOST:80/login
info: ** Serving oauth return endpoint: http://MY_HOST:80/oauth
notice: ** BOT ID: brian_williams ...attempting to connect to RTM!
** The RTM api just connected: brian_williams
info: ** API CALL: https://slack.com/api/channels.list
info: ** API CALL: https://slack.com/api/users.info
info: [Start]  0  Task for  U85BCRNCA in D86APN2QM
info: >   [Start]  0  Conversation with  U85BCRNCA in D86APN2QM
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/chat.postMessage
info: >   [End]  0  Conversation with  U85BCRNCA in D86APN2QM
info: [End]  0  Task for  U85BCRNCA in D86APN2QM
info: ** API CALL: https://slack.com/api/channels.list
info: ** API CALL: https://slack.com/api/users.info
info: [Start]  1  Task for  U85BCRNCA in D86APN2QM
info: >   [Start]  1  Conversation with  U85BCRNCA in D86APN2QM
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/chat.postMessage
info: >   [End]  1  Conversation with  U85BCRNCA in D86APN2QM
info: [End]  1  Task for  U85BCRNCA in D86APN2QM
info: ** API CALL: https://slack.com/api/users.info
{ token: '[removed]',
  ts: '1516198001.000165',
  channel: 'C87AQCM2B',
  as_user: true }
0x5c said: "Test"
Attempting to delete the message.
info: ** API CALL: https://slack.com/api/chat.delete
Message successfully deleted!
info: ** API CALL: https://slack.com/api/users.info
{ token: '[removed]',
  ts: '1516198115.000093',
  channel: 'C87AQCM2B',
  as_user: true }
0x5c said: "Test"
Attempting to delete the message.
info: ** API CALL: https://slack.com/api/chat.delete
Message successfully deleted!
info: ** API CALL: https://slack.com/api/users.info
{ token: '[removed]',
  ts: '1516198123.000453',
  channel: 'C87AQCM2B',
  as_user: true }
0x5c said: "Yeeeeeeeeooooooooooo"
Attempting to delete the message.
info: ** API CALL: https://slack.com/api/chat.delete
Message successfully deleted!
** The RTM api just closed
tshamz commented 6 years ago

Yah, I’ve been having this problem too with my instance of the bot too. I auth him, bring him online, and then make a post. Then I check back in on him a few days later and he’s offline. I think it has to do with the rtm being inactive for enough time that it shuts off. I’ll look into this.

On Wed, Feb 7, 2018 at 3:06 AM 0x5c notifications@github.com wrote:

Brianwilliams loose the connection to the slack workspace. It happens frequently, after a uptime of 1h to 7days. Sending commands to Brian does nothing, Brian stops deleting messages from channels. The "Howdy!" page stays up.

info: No persistent storage method specified! Data may be lost when process shuts down. info: Setting up custom handlers for processing Slack messages info: Configuring app as a Slack App! info: API CALL: https://slack.com/api/rtm.start info: Starting webserver on port 80 info: Serving webhook endpoints for Slash commands and outgoing webhooks at: http://MY_HOST:80/slack/receive info: Serving app landing page at : http://MY_HOST:80/ info: Serving login URL: http://MY_HOST:80/login info: Serving oauth return endpoint: http://MY_HOST:80/oauth notice: BOT ID: brian_williams ...attempting to connect to RTM! The RTM api just connected: brian_williams info: API CALL: https://slack.com/api/channels.list info: API CALL: https://slack.com/api/users.info info: [Start] 0 Task for U85BCRNCA in D86APN2QM info: > [Start] 0 Conversation with U85BCRNCA in D86APN2QM info: API CALL: https://slack.com/api/chat.postMessage info: API CALL: https://slack.com/api/chat.postMessage info: > [End] 0 Conversation with U85BCRNCA in D86APN2QM info: [End] 0 Task for U85BCRNCA in D86APN2QM info: API CALL: https://slack.com/api/channels.list info: API CALL: https://slack.com/api/users.info info: [Start] 1 Task for U85BCRNCA in D86APN2QM info: > [Start] 1 Conversation with U85BCRNCA in D86APN2QM info: API CALL: https://slack.com/api/chat.postMessage info: API CALL: https://slack.com/api/chat.postMessage info: > [End] 1 Conversation with U85BCRNCA in D86APN2QM info: [End] 1 Task for U85BCRNCA in D86APN2QM info: API CALL: https://slack.com/api/users.info { token: '[removed]', ts: '1516198001.000165', channel: 'C87AQCM2B', as_user: true } 0x5c said: "Test" Attempting to delete the message. info: API CALL: https://slack.com/api/chat.delete Message successfully deleted! info: API CALL: https://slack.com/api/users.info { token: '[removed]', ts: '1516198115.000093', channel: 'C87AQCM2B', as_user: true } 0x5c said: "Test" Attempting to delete the message. info: API CALL: https://slack.com/api/chat.delete Message successfully deleted! info: API CALL: https://slack.com/api/users.info { token: '[removed]', ts: '1516198123.000453', channel: 'C87AQCM2B', as_user: true } 0x5c said: "Yeeeeeeeeooooooooooo" Attempting to delete the message. info: API CALL: https://slack.com/api/chat.delete Message successfully deleted! The RTM api just closed

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tshamz/brianwilliams/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AB-qQLSCvr0aJ2EA4AwmWwaLVeb2vAEMks5tSYPDgaJpZM4R8h3J .

--

www.tylershambora.com http://www.tylershambora.com/

tshamz commented 6 years ago

looking into this next time i find some more time to work on this.

nepcore commented 6 years ago

I don't know if this works for you (our instance doesn't run on heroku but a dedicated server), but what i have done to overcome this problem is make the app exit after emitting the ** The RTM api just closed message (at the end of brianwilliams.js) and then write a simple bash script that simply reruns it whenever it quits

There are probably nicer ways to do this within the app, but that one works (at least as a workaround) and is implemented quickly