AgileVentures / asyncvoter-slack-bot

0 stars 0 forks source link

failure on server #19

Open tansaku opened 7 years ago

tansaku commented 7 years ago

When @mtc2013 was testing we got this failure:

ubuntu@ip-172-31-35-239:~/async_slack_bot$ { type: 'message',
  channel: 'D35B4MGCU',
  user: 'U02B6JMJ6',
  text: 'vote results',
  ts: '1481754694.000008',
  team: 'T0285CSTT',
  event: 'direct_message',
  match: [ 'vote', index: 0, input: 'vote results' ] }

/home/ubuntu/async_slack_bot/server.js:57
  vote = message.text.match(/\d+/)[0]
                                  ^
TypeError: Cannot read property '0' of null
    at Object.controller.hears.response (/home/ubuntu/async_slack_bot/server.js:57:35)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:852:28)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/SlackBot.js:720:34)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:983:32
    at Object.bot.findConversation (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/Slackbot_worker.js:678:9)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:979:21
    at next (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:82:27)
    at Ware.run (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:88:3)
tansaku commented 7 years ago

I'm thinking to set the bot running in a loop like this:

while true; do nodejs server.js; done
arreche commented 7 years ago

Or you could find out a way to run this service outside a tmux session.

Heroku restart processes automatically on failure.

tansaku commented 7 years ago

thanks for those links @arreche - I think the while true will restart on failure, but it's interesting all the stuff heroku supports for us, like ability to view logs and do restarts by team members ...

pm2 and forever look cool - will have to give those a spin