This repository was archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Error: Invalid response at Request._callback #888
Copy link
Copy link
Closed
Labels
Description
Botkit version: 0.5.4
Operating system: Ubuntu 16.04
Steps to reproduce:
- I used PM2 as my process monitor
- I ran the app
- I changed a line of code/restarted the app manually (I used PM2 watch feature). After that, sometimes, I couldn't connect to Slack RTM with error message given below. My guess is, my bot instance is somewhat "still connected" to Slack RTM API after restarting the app, and it can't override the "stuck" connection. Waiting for 15-20 seconds before trying again solved the problem.
Error message:
{"message":"Invalid response","stack":"Error: Invalid response\n at Request._callback (/home/imballinst/Documents/personal/insta-slackbot/node_modules/botkit/lib/Slack_web_api.js:259:32)\n at Request.self.callback (/home/imballinst/Documents/personal/insta-slackbot/node_modules/request/request.js:188:22)\n at emitTwo (events.js:106:13)\n at Request.emit (events.js:191:7)\n at Request.<anonymous> (/home/imballinst/Documents/personal/insta-slackbot/node_modules/request/request.js:1171:10)\n at emitOne (events.js:96:13)\n at Request.emit (events.js:188:7)\n at IncomingMessage.<anonymous> (/home/imballinst/Documents/personal/insta-slackbot/node_modules/request/request.js:1091:12)\n at IncomingMessage.g (events.js:291:16)\n at emitNone (events.js:91:20)"}
The error happened at these line of codes:
// botInstance is the object which was created using the .spawn(token)
botInstance.startRTM((err) => {
if (err) {
// I used winston as logger
LogUtil.winston.log('error', err);
}
});
Am I missing something here? I didn't find the error code Invalid response either from https://api.slack.com/methods/rtm.connect, so I think the problem lies in this module. Any insight/help greatly appreciated, thanks! :)