RocketChat / RocketChat/Rocket.Chat
The integration failed to send a message to "#channel" because user "rocket.cat" doesn't have permission or is not a member of the channel
@gabrieleiro is already working on this.
Since Nov 12, 2020.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Last night I updated my server to the latest version (3.4.2) and I now have a message in my logs telling me that the user "rocket.cat" (bot) can't send messages sometimes.
Steps to reproduce:
I can't reproduce the problem when I do a curl on the API manually I don't get an error message that appears.
Expected behavior:
Do not have WARNING in the logs.
Actual behavior:
Command sent by my monitoring system to RocketChat:
curl -X POST --data-urlencode "payload={\"username\":\"Zabbix\",\"text\":\":x: *More than 99% used on dataset test/torture on srv-63*\"}" https://chat.cosium.com/hooks/XXXXXXXXXXX
Log of my monitoring system telling me that it sent this message:
2020-07-22 14:52:08 | XXXXXXXXXXX | :x: *More than 99% used on zpool test on srv-63*
Error from the RocketChat server telling me that it can't send the message because it doesn't have the rights:
Jul 22 14:52:08 rocketchat rocketchat[3662]: Warning: The integration "sysnet-test" failed to send a message to "#sysnet-test" because user "rocket.cat" doesn't have permission or is not a member of the channel.
The alert is sent in the channel on RocketChat:
Zabbix @rocket.cat Bot 2:52 PM
❌ More than 99% used on dataset test/torture on srv-63
I don't understand why he's telling me he can't send it if he's sending it anyway. As I said before, it is impossible to reproduce the problem manually and it happens randomly on some messages.
Server Setup Information:
- Version of Rocket.Chat Server: 3.4.2
- Operating System:
- Deployment Method: manual
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 12.18.2
- MongoDB Version: 3.6.16
Relevant logs:
Jul 22 14:52:08 rocketchat rocketchat[3662]: Warning: The integration "sysnet-test" failed to send a message to "#sysnet-test" because user "rocket.cat" doesn't have permission or is not a member of the channel.
Jul 22 14:52:08 rocketchat rocketchat[3662]: This behavior is deprecated and starting from version v4.0.0 the following error will be thrown and the message will not be sent.
Jul 22 14:52:08 rocketchat rocketchat[3662]: Error: error-not-allowed
Jul 22 14:52:08 rocketchat rocketchat[3662]: at app/authorization/server/functions/canSendMessage.js:19:9
Jul 22 14:52:08 rocketchat rocketchat[3662]: at /home/rocket/3.4.2/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
Jul 22 14:52:08 rocketchat rocketchat[3662]: => awaited here:
Jul 22 14:52:08 rocketchat rocketchat[3662]: at Function.Promise.await (/home/rocket/3.4.2/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at validateRoomMessagePermissions (app/authorization/server/functions/canSendMessage.js:48:101)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at processWebhookMessage (app/lib/server/functions/processWebhookMessage.js:90:4)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at Object.executeIntegrationRest (app/integrations/server/api/api.js:250:19)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at app/api/server/api.js:388:82
Jul 22 14:52:08 rocketchat rocketchat[3662]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at Object._internalRouteActionHandler [as action] (app/api/server/api.js:388:39)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)
Jul 22 14:52:08 rocketchat rocketchat[3662]: at packages/nimble_restivus/lib/route.coffee:59:33
Jul 22 14:52:08 rocketchat rocketchat[3662]: at packages/simple_json-routes.js:98:9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.