Report this

What is the reason for this report?

hubot rocket.chat adapter cannot be restarted without re-configuration

Posted on October 19, 2016

Every time when i started hubot, i have to do the following first before bin/hubot -a rocketchat? Why is that?

export ROCKETCHAT_USER=bot
export ROCKETCHAT_PASSWORD=bot
export ROCKETCHAT_AUTH=password

Also I did install redis and hubot-redis-brain, and from the following info i got when i log in hubot, the adapter did connect to redis:

[Wed Oct 19 2016 02:44:24 GMT+0000 (UTC)] INFO hubot-redis-brain: Using default redis on localhost:6379
[Wed Oct 19 2016 02:44:24 GMT+0000 (UTC)] INFO hubot-redis-brain: Data for hubot brain retrieved from Redis



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

The lines before are environment variables. We use this to pass important information to the adapter so it knows how to connect to Rocket.Chat. Adding redis or redis brain doesn’t give the bot the ability to remember this.

So a common solution here would be to make use of a bash file. So create a file like start_hubot with contents like this:

#!/bin/bash

export ROCKETCHAT_USER=bot
export ROCKETCHAT_PASSWORD=bot
export ROCKETCHAT_AUTH=password
export HUBOT_YOUTUBE_API_KEY=<your token>

bin/hubot -a rocketchat

Then to make it executable run: chmod +x start_hubot

So then when you want to run hubot you can just do: ./start_hubot

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.