RocketChat / RocketChat/Rocket.Chat

SlackBridge "onMessage Error: Not enough permission" since v3.15.0

Open
#22,217 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

After upgrading from v3.14.4 to v3.15.0, SlackBridge stopped working (at least when sending from Slack to Rocket.Chat).

I tried to rollback to 3.14.4 by changing the tag in docker-compose.yml and rebuilding the containers but Rocket.Chat throws Can’t find migration version 225 which I guess is not surprising since mongodb’s structure/schema must have change between 3.14 and 3.15.

If we restore a mongodump backup from before the upgrade we are going to lose a few days of data which is not a good solution.

Steps to reproduce:

Post a message in a Slack channel that is paired with a Rocket.Chat channel (which used to work before 3.15.0)

Expected behavior:

Message is posted in Rocket.Chat

Actual behavior:

No message is posted from Slack to Rocket.Chat, instead the following error is logged:

server.js:204 SlackBridge ➔ Slack.error Unhandled error onMessage Error: Not enough permission
at validateMessage (app/lib/server/functions/sendMessage.js:151:10)
at sendMessage (app/lib/server/functions/sendMessage.js:165:2)
at RocketAdapter.createAndSaveMessage (app/slackbridge/server/RocketAdapter.js:499:5)
at SlackAdapter.processNewMessage (app/slackbridge/server/SlackAdapter.js:830:17)
at SlackAdapter.onMessage (app/slackbridge/server/SlackAdapter.js:453:9)
at app/slackbridge/server/SlackAdapter.js:108:11
at runWithEnvironment (packages/meteor.js:1286:24)

On the other hand sending a message from Rocket.Chat to Slack still works fine, as it did in 13.4.4

Server Setup Information:
  • Version of Rocket.Chat Server: 3.15.0
  • Operating System: Debian
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.24 / mmapv1 (oplog Enabled)
  • Proxy: traefik
  • Firewalls involved: iptables managed by Docker

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with app/slackbridge/server/SlackAdapter.js and RocketAdapter.js, then trace the reported call through app/lib/server/functions/sendMessage.js, especially validateMessage. Reproduce by posting in a paired Slack channel on Rocket.Chat 3.15.0 and compare the permission failure with the expected successful message delivery.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.