使用mlab、Meteor和部署到银河,我收到了error "not authorized on <DB> to execute command"。
当我不小心删除了用来登录的数据库用户时,这个错误就开始了。我重新创建了用户。我确保我的帐户用户具有相同的用户名和密码。数据库用户具有以下身份证明:
{
"_id": "db.username",
"user": "username",
"db": "password",
"roles": [
{
"role": "dbOwner",
"db": "db"
}
]
}我的设置url未更改:
mongodb://username:password@ds115758.mlab.com:15758/db我做错了什么?这快把我逼疯了:
错误:
Exception in setInterval callback: MongoError: not authorized on db to execute command { delete: "meteor_oauth_pendingRequestTokens", ordered: true, $db: "db" }发布于 2018-10-24 01:33:54
联系support@mlab.com.他们非常有帮助,帮助我调试和解决了我的问题。
如果它有帮助,正在进行的身份验证问题是由于我的Galaxy应用程序在删除数据库用户后没有关闭和重新打开连接。我已经在下面包含了一些显示此行为的日志消息:
2018-10-22T05:00:00.798-0700 I COMMAND [conn616856] command db.dbname command: insert { insert: "dbname", ordered: true, $db: "db" } ninserted:1 keysInserted:1 numYields:0 reslen:229 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, MMAPV1Journal: { acquireCount: { w: 2 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 46 } }, Database: { acquireCount: { w: 2 } }, Collection: { acquireCount: { W: 1 } }, Metadata: { acquireCount: { W: 1 } }, oplog: { acquireCount: { W: 1 } } } protocol:op_query 182ms
2018-10-22T23:15:34.155-0700 I ACCESS [conn616856] Removed deleted user dbusername@db from session cache of user information.
2018-10-22T23:15:34.155-0700 I ACCESS [conn616856] Unauthorized: not authorized on db to execute command { find: "meteor_accounts_loginServiceConfiguration", filter: {}, projection: { secret: 0 }, $db: "db" }从昨天,当用户被删除时:
2018-10-22T05:00:00.798-0700 I COMMAND [conn616856] command db.dbname command: insert { insert: "dbname", ordered: true, $db: "db" } ninserted:1 keysInserted:1 numYields:0 reslen:229 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, MMAPV1Journal: { acquireCount: { w: 2 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 46 } }, Database: { acquireCount: { w: 2 } }, Collection: { acquireCount: { W: 1 } }, Metadata: { acquireCount: { W: 1 } }, oplog: { acquireCount: { W: 1 } } } protocol:op_query 182ms
2018-10-22T23:15:34.155-0700 I ACCESS [conn616856] Removed deleted user dbusername@db from session cache of user information.
2018-10-22T23:15:34.155-0700 I ACCESS [conn616856] Unauthorized: not authorized on db to execute command { find: "meteor_accounts_loginServiceConfiguration", filter: {}, projection: { secret: 0 }, $db: "db" }从今天开始;注意未授权的消息如何具有相同的线程ID (conn616856):
2018-10-23T09:24:54.778-0700 I ACCESS [conn616856] Unauthorized: not authorized on db to execute command { delete: "meteor_oauth_pendingCredentials", ordered: true, $db: "db" }
2018-10-23T09:27:54.785-0700 I ACCESS [conn616856] Unauthorized: not authorized on db to execute command { delete: "meteor_oauth_pendingCredentials", ordered: true, $db: "db" }
2018-10-23T09:30:54.794-0700 I ACCESS [conn616856] Unauthorized: not authorized on db to execute command { delete: "meteor_oauth_pendingCredentials", ordered: true, $db: "db" }删除数据库用户时,所有现有连接都失去了删除的权限。这些连接需要重新进行身份验证,或者需要创建新的经过身份验证的连接。
我尝试关闭我的连接并重新启动它,它似乎工作得更好。
丹吉尔
https://stackoverflow.com/questions/52945235
复制相似问题