hubot-matteruser icon indicating copy to clipboard operation
hubot-matteruser copied to clipboard

Migrating hubot to a bot account breaks it partially

Open camaer opened this issue 5 years ago • 3 comments

With the new bot account from Mattermost, I converted my existing hubot user to a fully fledged bot account. Doing so partially broke it.

Writing directly to the bot in a private message works perfectly but the issue is when posting in other channels. The bot has the 'System Admin' permission but is no longer monitoring the other channel and since it's a bot account it cannot be added as member since by default he's already a member of all the channels as sys admin.

A direct message to the bot to trigger a message in another room result in a 'permission denied'

Here's an exemple:

In a direct message:

hubot announce 'maintenance starting now' in tests channel

Result in the following line in the log:

{"level":"error","ts":1578947833.2254527,"caller":"mlog/log.go:174","msg":"You do not have the appropriate permissions","path":"/api/v4/posts","request_id":"ksc5t5wbjbr4tjnb15mqaj9h7e","ip_addr":"192.168.10.170","user_id":"dq3ryuzuk3dmijt6o7dhzuccne","method":"POST","err_where":"Permissions","http_code":403,"err_details":"userId=dq3ryuzuk3dmijt6o7dhzuccne, permission=create_post"}

camaer avatar Jan 13 '20 20:01 camaer

image

you can check permissions for the account

jk2K avatar Jul 01 '20 10:07 jk2K

Both permissions are enabled already

camaer avatar Jul 01 '20 12:07 camaer

In our context, after similar migration (user -> bot account) we noticed a strange behavior.

One of our action is based on two reply. The first one appears, but not the second one (only logged in console).

gbonnefille avatar Sep 07 '20 11:09 gbonnefille