使用 mongo 3.2 时出现随机“MongoError:未授权 XXX 执行命令 {YYY}”

使用 mongo 3.2 时出现随机“MongoError:未授权 XXX 执行命令 {YYY}”

从最近开始我遇到了如下随机错误:

2016-06-06T18:17:55.386Z pid:2458 worker:3 MongoError: not authorized on db to execute command {...someQuery...}
2016-06-06T18:17:55.386Z pid:2458 worker:3     at Function.MongoError.create (/var/lib/strong-pm/svc/1/work/a6e0bde254cbdedde6345bdf94e29e51828c5fa2.1465232211706/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/error.js:31:11)
2016-06-06T18:17:55.386Z pid:2458 worker:3     at queryCallback (/var/lib/strong-pm/svc/1/work/a6e0bde254cbdedde6345bdf94e29e51828c5fa2.1465232211706/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:200:36)
2016-06-06T18:17:55.386Z pid:2458 worker:3     at Callbacks.emit (/var/lib/strong-pm/svc/1/work/a6e0bde254cbdedde6345bdf94e29e51828c5fa2.1465232211706/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
2016-06-06T18:17:55.386Z pid:2458 worker:3     at null.messageHandler (/var/lib/strong-pm/svc/1/work/a6e0bde254cbdedde6345bdf94e29e51828c5fa2.1465232211706/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:397:23)
2016-06-06T18:17:55.387Z pid:2458 worker:3     at Socket.<anonymous> (/var/lib/strong-pm/svc/1/work/a6e0bde254cbdedde6345bdf94e29e51828c5fa2.1465232211706/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/connection/connection.js:302:22)
2016-06-06T18:17:55.387Z pid:2458 worker:3     at emitOne (events.js:90:13)
2016-06-06T18:17:55.387Z pid:2458 worker:3     at Socket.emit (events.js:182:7)
2016-06-06T18:17:55.387Z pid:2458 worker:3     at readableAddChunk (_stream_readable.js:153:18)
2016-06-06T18:17:55.388Z pid:2458 worker:3     at Socket.Readable.push (_stream_readable.js:111:10)
2016-06-06T18:17:55.388Z pid:2458 worker:3     at TCP.onread (net.js:529:20)

我正在运行 mongo 3.2,使用最新的 nodeJs mongodb 驱动程序(node-mongodb-native 2.1.21)和 strongloop API 框架(任何组件和相关依赖项中的最新组件和相关依赖项)

身份验证模式为 2(P/S)+1(A) 副本集上的 SCRAM-SHA-1

这不是连接或密码问题。它是在 API 框架设置的现有连接池中突然出现的

有人经历过类似的事情吗?

答案1

这可能是最近的节点驱动程序回归:https://jira.mongodb.org/browse/NODE-726.降级到 2.1.18。

相关内容