2

I am testing Rocket Chat for the first time and I am following this guide to Deploy with Docker

I have started Rocket Chat successfully and I am now trying to enable the Hubot. I have created a user called bot and I have modified the file docker-compose.yml with the updated login information.

Here is my file:

mongo:
  image: mongo
# volumes:
#    - ./data/runtime/db:/data/db
#    - ./data/dump:/dump
  command: mongod --smallfiles --oplogSize 128

rocketchat:
  image: rocketchat/rocket.chat:latest
# volumes:
#    - ./uploads:/app/uploads
  environment:
    - PORT=3000
    - ROOT_URL=http://localhost:3000
    - MONGO_URL=mongodb://mongo:27017/rocketchat
  links:
    - mongo:mongo
  ports:
    - 3000:3000

# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
  image: rocketchat/hubot-rocketchat
  environment:
    - ROCKETCHAT_URL=localhost:3000
    - LISTEN_ON_ALL_PUBLIC=true
    - ROCKETCHAT_ROOM=''
    - ROCKETCHAT_USER=bot
    - ROCKETCHAT_PASSWORD=hubot
    # - RESPOND_TO_DM=true
    #- ROCKETCHAT_AUTH=password
    - BOT_NAME=bot
# you can add more scripts as you'd like here, they need to be installable by npm
    - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
  links:
    - rocketchat:rocketchat
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
  ports:
    - 3001:8080

I have started the container with Hubot but it does not seem to respond to the command within Rocket Chat. I am not sure what is the expected output, but it seems that he can't connect to localhost:3000 which is the URL I use to open Rocket Chat.

> docker-compose up hubot   
Recreating rocketchat_mongo_1...
Recreating rocketchat_rocketchat_1...
Recreating rocketchat_hubot_1...
Attaching to rocketchat_hubot_1
hubot_1 | hubot-help@0.1.3 node_modules/hubot-help
hubot_1 | 
hubot_1 | hubot-diagnostics@0.0.1 node_modules/hubot-diagnostics
hubot_1 | 
hubot_1 | hubot-links@0.0.1 node_modules/hubot-links
hubot_1 | 
hubot_1 | hubot-seen@0.2.3 node_modules/hubot-seen
hubot_1 | ├── timeago@0.1.0
hubot_1 | └── coffee-script@1.6.3
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Starting Rocketchat adapter...
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Once connected to rooms I will respond to the name: bot
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Connecting To: localhost:3000

Do you have any suggestion?

Thanks!

Marcelo Schmidt
  • 609
  • 4
  • 15
Muffo
  • 1,733
  • 2
  • 19
  • 29

2 Answers2

3

You use localhost:3000 from your machine, but form inside the hubot container, it should be rocketchat:3000 as you defined in the links.

  • Thanks for the answer. I did the changes but I am getting stuck at the same point... hubot_1 | [Wed Feb 24 2016 19:49:42 GMT+0000 (UTC)] INFO Connecting To: rocketchat:3000 – Muffo Feb 24 '16 at 19:53
1

Unfortunately your ouput is truncated.

In my case the error was not a connection problem but the fact that the dockerfile is pulling the rocketchat/hubot-rocketchat image which is referring to a 1.x version. On the rocketbot github page (https://github.com/RocketChat/hubot-rocketchat) it states

Please DO NOT USE v1.x.x of the adapter. It is experimental, and in anticipation of a performance oriented sweeping change within the core which has not happened yet.

Please continue to use Hubot Adapter v0.1.x until further notice.

So I changed the line to

  image: rocketchat/hubot-rocketchat:v0.1.4 # rocketchat/hubot-rocketchat

and sudddenly rocketchat bot is talking.

jdoose
  • 503
  • 1
  • 6
  • 6
  • 1
    This is an awesome fix for a different error ;) I'll update the docs for using docker-compose. – Marcelo Schmidt Jul 19 '16 at 19:35
  • Hi @MarceloSchmidt, were the docs updated? It was only when I came here, that I realized it was possible / desirable to run hubot-rocketchat via docker-compose. (Yup, I'm pretty new in this area.) – antgel Aug 21 '16 at 16:01
  • Hello, yes, please check out the link we refer to in our docs: https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/docker-compose.yml – Marcelo Schmidt Aug 23 '16 at 23:32
  • hi, I have setup hubot with rocket chat. And got connected successfully. But it is not responding to me. I posted another question for the same https://stackoverflow.com/questions/52659602/rocket-chat-hubot-adapter-is-not-replying-back – jitendra rajput Oct 05 '18 at 09:04