-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.21
-
Component/s: None
-
Environment:mongod: 2.6.11
node-mongodb-native: 2.1.21
node: 4.3.1
But there is also a report with (https://groups.google.com/forum/#!searchin/mongodb-user/not$20authorized$20for$20query/mongodb-user/jjlFcY1fjWA/MNd_53YdBgAJ):
mongod version: 3.0.12
node-mongodb-native: 2.1.21
mongojs: 2.4.0
node: 4.4.3
-
Empty show more show less
Some queries fail with a MongoError: not authorized for query error.
Looking at the database logs, it seems that on re-connection, queries are sometimes executed before the authentication takes place.
My logs:
2016-06-01T14:21:04.428+0000 [initandlisten] connection accepted from 10.3.10.10:49571 #1214467 (33 connections now open) 2016-06-01T14:21:04.454+0000 [conn1214467] assertion 13 not authorized for query on iwecore1.54f6d527f6b4aa13006b2cfa.iwe-Report ns:iwecore1.54f6d527f6b4aa13006b2cfa.iwe-Report query:{ _id: ObjectId('56a10458586a4e1e00ed2237') } 2016-06-01T14:21:04.454+0000 [conn1214467] ntoskip:0 ntoreturn:1 2016-06-01T14:21:04.454+0000 [conn1214467] authenticate db: iwecore1 { authenticate: 1, user: "iwecore", nonce: "xxx", key: "xxx" }
I have rolled back to node-mongodb-native 2.1.18 because the problem seems to appear in later versions.