Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo bot crashes when trying to send a message - channel_type = channel['channel']['type'] - KeyError: 'channel' #49

Open
mechastorm opened this issue Oct 18, 2017 · 0 comments

Comments

@mechastorm
Copy link

mechastorm commented Oct 18, 2017

Where should I debug this issue I am having? I had spun up the bot from the demo installation instructions.

  • It can join the channel
  • I can manually log it in the channel as well
  • the bot starts up fine

The minute I try to send a message in the public channel

  • example: just saying hello
  • bot detects
  • attempts to send a response
  • crashes

The crash log

[dd/mm/2017 23:16:18] Starting new HTTP connection (1): my-mattermost-server
[dd/mm/2017 23:16:18] http://my-mattermost-server:80 "GET /api/v3/teams/xxx/channels/yyy/ HTTP/1.1" 500 256
Traceback (most recent call last):
  File "/home/vagrant/my-bot/venv/bin/matterbot", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/cli.py", line 18, in main
    b.run()
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/bot.py", line 37, in run
    self._dispatcher.loop()
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 116, in loop
    self._on_new_message(self.event)
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 92, in _on_new_message
    if self.is_mentioned(msg) or self.is_personal(msg):
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 54, in is_personal
    channel_type = channel['channel']['type']
KeyError: 'channel'

Is this a permission issue? My bot account can talk in the public channel with no issues when I manually log it into the system. But through the mattermost bot, it crashes.

My sample config

DEBUG = True
SSL_VERIFY = False
BOT_URL = 'http://my-mattermost-server/api/v3'
BOT_LOGIN = 'my_bot_username'
BOT_PASSWORD = 'my_bot_pass'
BOT_TEAM = 'my-channel'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant