Mattermost Channel debugging

I have a Mattermost site running locally and exposed at localhost:8065. I have a Rasa instance running rasa run --debug locally as well, exposed as localhost:5005. I created an outgoing webhook in Mattermost according to your doc at: https://rasa.com/docs/rasa/user-guide/connectors/mattermost/#getting-credentials and set the Callback URL to http://localhost:5005/webhooks/mattermost/webhook. Does that mean I need to edit the credentials.yml, mattermost section to look like:

mattermost:
  url: "http://localhost:8065/hooks/xx615yapapbipeqyqtn3xasc4a"
  team: "Groupname"
  user: "Username"
  pw: "********"

Where the url is the outgoing webhook with it’s token. Also had to AllowUntrustedInternalConnections to 127.0.0.1/8

I’m getting

2019-10-10 15:23:46 ERROR    rasa.core.channels.mattermost  - Exception when trying to handle message.'token'
2019-10-10 15:23:46 DEBUG    rasa.core.channels.mattermost  - 'token'
Traceback (most recent call last):
  File "c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\mattermost.py", line 98, in webhook
    self.url, self.team, self.user, self.pw, self.bot_channel
  File "c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\mattermost.py", line 27, in __init__
    super(MattermostBot, self).login(user, pw)
  File "c:\programdata\anaconda3\envs\rasa\lib\site-packages\mattermostwrapper\wrapper.py", line 39, in login
    self.token = p.headers["Token"] # Store the token for further requests
  File "c:\programdata\anaconda3\envs\rasa\lib\site-packages\requests\structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'token'

and no response from the bot.So something is being sent to rasa (I’m trying to find the exact json) and rasa is choking on it.

So I can try to take a look at this, I wrote the mattermost wrapper that is used but I also haven’t updated it in a while so this could be related to Mattermost updates as well.

Give me a few days and I’ll test my wrapper code to ensure it isn’t the issue here either. I’m assuming you never have had this working yet?

Thanks

Thank you. The logs appear to indicate that Rasa is receiving some input from the webhook, but is unable to interpret it. Any tips for debugging that I can do on my own?

Nothing immediately comes to mind I haven’t tested out the mattermost wrapper I wrote in a while so its very possible something has changed. I just need to get my server up again and test it.