2015-08-25 35 views
1

確保蒙戈與--auth參數固定蒙戈後之後,我收到以下錯誤信息:與摩卡流星速度測試失敗,並授權

MongoError: not authorized on mocha to execute command { listIndexes: "users", cursor: {} }

蒙戈是我的本地機器上的默認端口localhost:27017上。 谷歌和stackexchange搜索顯示沒有類似的,所以任何幫助,將不勝感激。

大概我所需要做的就是授權用戶使用'摩卡'分貝。 誰是用戶?

完整的堆棧跟蹤:

W20150822-22:58:09.173(1)? (STDERR) 

/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:278 
W20150822-22:58:09.173(1)? (STDERR)       throw(ex); 
W20150822-22:58:09.173(1)? (STDERR)        ^
W20150822-22:58:09.214(1)? (STDERR) MongoError: not authorized on mocha to execute command { listIndexes: "users", cursor: {} } 
W20150822-22:58:09.214(1)? (STDERR)  at Object.Future.wait (/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15) 
W20150822-22:58:09.214(1)? (STDERR)  at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:733:1) 
W20150822-22:58:09.214(1)? (STDERR)  at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:620:1) 
W20150822-22:58:09.215(1)? (STDERR)  at Accounts.urls (packages/accounts-base/accounts_server.js:1309:1) 
W20150822-22:58:09.215(1)? (STDERR)  at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/packages/accounts-base.js:1616:4 
W20150822-22:58:09.215(1)? (STDERR)  at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/packages/accounts-base.js:1659:3 
W20150822-22:58:09.215(1)? (STDERR)  at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/boot.js:222:10 
W20150822-22:58:09.215(1)? (STDERR)  at Array.forEach (native) 
W20150822-22:58:09.215(1)? (STDERR)  at Function._.each._.forEach (/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11) 
W20150822-22:58:09.215(1)? (STDERR)  at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/boot.js:117:5 
W20150822-22:58:09.215(1)? (STDERR)  - - - - - 
W20150822-22:58:09.216(1)? (STDERR)  at Object.toError (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/utils.js:114:11) 
W20150822-22:58:09.216(1)? (STDERR)  at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/db.js:1194:31 
W20150822-22:58:09.216(1)? (STDERR)  at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/db.js:1903:9 
W20150822-22:58:09.216(1)? (STDERR)  at Server.Base._callHandler (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/base.js:453:41) 
W20150822-22:58:09.216(1)? (STDERR)  at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:487:18 
W20150822-22:58:09.216(1)? (STDERR)  at [object Object].MongoReply.parseBody (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) 
W20150822-22:58:09.216(1)? (STDERR)  at [object Object].<anonymous> (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:445:20) 
W20150822-22:58:09.216(1)? (STDERR)  at [object Object].emit (events.js:95:17) 
W20150822-22:58:09.216(1)? (STDERR)  at [object Object].<anonymous> (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13) 
W20150822-22:58:09.217(1)? (STDERR)  at [object Object].emit (events.js:98:17) 

回答

0

答案似乎很明顯,現在我已經工作了。

誰也看不懂的摩卡分貝用戶在MONGO_URL,在這個例子中是myUser

出口MONGO_URL = 「的MongoDB:// MYUSER:密碼@本地/ MYDB/authSource = admin」 的用戶

您必須爲myUser a readWrite角色生產db(本例中爲mydb)和mocha db。