RocketChat / RocketChat/Rocket.Chat
[Bug][Federation] Request that loops
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
I hope you are well.
Description:
I am currently in version 3.4.2 of the official docker image ( rocketchat/rocket.chat ) , when I switch to 3.6.2 the migration is done correctly, but when I go to the federation dashboard the application crashes.
Steps to reproduce:
Go to Admin
Click on Federation Dashboard
Expected behavior:
See the dashboard
Actual behavior:
I noticed that a loop is created in the developer console with many call of :
/api/v1/method.call/federation%3AgetOverviewData && /api/v1/method.call/federation%3AgetServers
The application ends up crashing due to api limits.
Server Setup Information:
- Version of Rocket.Chat Server: 3.6.2
- Operating System: linux
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 12.16.1 - x64
- MongoDB Version: 4.0
Client Setup Information
- Desktop App or Browser Version: Chromium Version 85.0.4183.102 (Official Build) snap (64-bit)
- Operating System: Ubuntu 20.04
Additional context
Relevant logs:
Exception while invoking method federation:getOverviewData Error: Error, too many requests. Please slow down. You must wait 27 seconds before trying again. [too-many-requests]
at Object.post (app/api/server/v1/misc.js:255:11)
at app/api/server/api.js:394:82
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39)
at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)
at packages/nimble_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:98:9
API ➔ debug Success {
statusCode: 200,
body: {
message: '{"msg":"result","id":"3947","error":{"isClientSafe":true,"error":"too-many-requests","reason":"Error, too many requests. Please slow down. You must wait 27 seconds before trying again.","details":{"timeToReset":26564},"message":"Error, too many requests. Please slow down. You must wait 27 seconds before trying again. [too-many-requests]","errorType":"Meteor.Error"}}',
success: true
}
}
API ➔ debug POST: /api/v1/method.call/federation%3AgetServers
RateLimiter ➔ info DDP RATE LIMIT: limit by userId per method
RateLimiter ➔ info {
"allowed": false,
"timeToReset": 6863,
"numInvocationsLeft": 0,
"userId": "xxxxxxxxxxxxx",
"clientAddress": "x.x.x.x",
"type": "method",
"name": "federation:getServers",
"connectionId": "xxxxxxxxx",
"broadcastAuth": false
}
Thank you
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.
Research direction
Start at the Federation Dashboard and trace its requests to federation:getOverviewData and federation:getServers. Inspect the referenced API paths in app/api/server/v1/misc.js and app/api/server/api.js, reproduce the repeated calls, and verify that the dashboard loads without looping or triggering rate-limit errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, mongodb, node.js
- Domain
- api, distributed-systems, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100