-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.21
-
Component/s: MongoDB 3.2
-
Empty show more show less
I'm running my API method collecting everyday statistic simultaneously for 20 days (20 times):
this.collection.aggregate( { $group: { _id: { "active": "$enable" }, count: { $sum: 1 } } }, { $project:{ "active": "$_id.active", "_id": 0, "count": 1 } }, callback);
During local tests on the workstation I got the next error every time after starting the application:
errmsg: 'not authorized on <servername> to execute command { aggregate: "tasks", pipeline: [ { $match: { createdTs:
, type:
{ $in: [ 1, 2, 7 ] }} }, { $group: { _id:
{ type: "$type" }, count:
{ $sum: 1 }} }, { $project:
{ type: "$_id.type", _id: 0, count: 1 } } ] }'
Second and other calls to the API is always succeeded. Then I wait till the number of connections decreases from 5 (default pollSize) to the 2. After this I get this message again for a one time.
On the server I always have this message for a first time but I didn't find a relation between the error and the number of connections. Just after some delay in requests (3-5 mins) I get the error for a first time and the other requests are succeed.
This error is not appearing when I set poolSize: 1.
Could you tell me what is going wrong with this request or what information I should collect additionally to troubleshoot this error?
Thank you!