Mattermost, Inc.

Debugging mattermost bot failure(s)

I’ve been trying to get a bot running on mattermost to respond to ‘calendar’ queries. I’m running Mattermost 3.2.0

I’ve tried hubot-matteruser,hubot-mattermost and mattermost_bot

hubot-mattermost says it runs, and even with debug mode turned on I get no errors. And I never see it show up in any channels and when I message it directly it doesn’t respond

hubot-matteruser runs, but the flails with the following error

[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG POST /users/login
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] INFO Websocket URL: wss://team.example.com:443/api/v3/users/websocket
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] INFO Logged in as user “hubot” but not connected yet.
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG GET /users/initial_load
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG Found 1 teams.
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG Testing example.com == example.com
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG Found team! …
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG GET /users/profiles/…
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] DEBUG GET /teams/…/channels
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] INFO Connecting…
[Tue Sep 06 2016 18:21:45 GMT-0700 (PDT)] INFO Connected to Mattermost.
[Tue Sep 06 2016 18:21:46 GMT-0700 (PDT)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (https://github.com/github/hubot-scripts/issues/1113) in f
avor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
[Tue Sep 06 2016 18:21:46 GMT-0700 (PDT)] INFO Starting pinger…
[Tue Sep 06 2016 18:21:46 GMT-0700 (PDT)] DEBUG Found 5 channels.
[Tue Sep 06 2016 18:21:46 GMT-0700 (PDT)] DEBUG Found 8 profiles.
[Tue Sep 06 2016 18:22:16 GMT-0700 (PDT)] INFO ping
[Tue Sep 06 2016 18:22:16 GMT-0700 (PDT)] ERROR TypeError: Cannot read property ‘text’ of undefined
at Client.onMessage (/home/hubot-matteruser/node_modules/mattermost-client/src/client.coffee:224:20, :295:28)
at WebSocket. (/home/hubot-matteruser/node_modules/mattermost-client/src/client.coffee:159:13, :218:22)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:191:7)
at Receiver.ontext (/home/hubot-matteruser/node_modules/ws/lib/WebSocket.js:841:10)
at /home/hubot-matteruser/node_modules/ws/lib/Receiver.js:536:18
at Receiver.applyExtensions (/home/hubot-matteruser/node_modules/ws/lib/Receiver.js:371:5)
at /home/hubot-matteruser/node_modules/ws/lib/Receiver.js:508:14
at Receiver.flush (/home/hubot-matteruser/node_modules/ws/lib/Receiver.js:347:3)
at Receiver.opcodes.1.finish (/home/hubot-matteruser/node_modules/ws/lib/Receiver.js:541:12)
at Receiver.expectHandler (/home/hubot-matteruser/node_modules/ws/lib/Receiver.js:499:31)
at Receiver.add (/home/hubot-matteruser/node_modules/ws/lib/Receiver.js:103:24)
at TLSSocket.realHandler (/home/hubot-matteruser/node_modules/ws/lib/WebSocket.js:825:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
at TLSSocket.Readable.push (_stream_readable.js:135:10)
at TLSWrap.onread (net.js:542:20)

[Tue Sep 06 2016 18:22:45 GMT-0700 (PDT)] INFO Reconnecting in 1000ms

Then it just keeps reconnecting.

mattermost_bot runs, and responds but I need it to be in a ‘channel’ so everyone can address it without direct messaging and I don’t know how to get it to join a channel.

What I’m trying to set up is a calendar, much like the /reminder in slack. Someone says ‘calendar doctors appointment tomorrow’ and it gets added to a calendar, probably a text file something simple. I’ve researched and Googled and can’t seem to find any simple way to do this.

Any assistance would be GREATLY appreciated.