I hope you are well.
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.
Go to Admin
Click on Federation Dashboard
See the dashboard
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.
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


@piotrkochan can you please update to the latest version, 3.6.3, and check again?
@alansikora I'm already on 3.6.3
I confirm, same behavior in 3.6.3
Hi, same behavior in 3.7.0

That issue cause DDP Rate limiter go crazy when I just open federation dashboard


Hello,
I'm also have this exact issue after the updating from 3.4.x to 3.6. My log looks exactly like piotrkochan above, same line numbers etc. I've now updated to 3.7.1 and still the issue exists. The database migration seems to have worked fine.
I upgraded from 2.4.11 to 3.6.3 and have the same problem.
After taking a look at the code, and knowing that the error occurs in calls to federation:getOverviewData and federation:getServers, I think that the problem may be in client/contexts/ServerContext.ts:usePolledMethodData, as this function is only used for these two calls.
I don't have a local build that I can test this on, but could it be that the useEffect cache parameters ([fetchData, intervalMs]), are causing the effect to be executed in every frame update? Maybe fetchData is not being cached properly and is returning a new function every time?
After some local debugging, I think I found the issue. I opened a PR with the fix: #19386
For anyone not following the PR comments, it seems that this had already been fixed in https://github.com/RocketChat/Rocket.Chat/pull/18520, so I guess it will be included in the next release.
Most helpful comment
I upgraded from 2.4.11 to 3.6.3 and have the same problem.
After taking a look at the code, and knowing that the error occurs in calls to
federation:getOverviewDataandfederation:getServers, I think that the problem may be inclient/contexts/ServerContext.ts:usePolledMethodData, as this function is only used for these two calls.I don't have a local build that I can test this on, but could it be that the
useEffectcache parameters ([fetchData, intervalMs]), are causing the effect to be executed in every frame update? MaybefetchDatais not being cached properly and is returning a new function every time?