流星帐号不起作用

时间:2013-08-21 15:17:05

标签: mongodb meteor accounts

基本问题:登录Meteor应用程序无效,我不知道原因。

我有一个使用accounts-password包的流星应用程序,但每当我尝试登录时(无论是使用accounts-ui下拉列表还是通过调用Meteor.loginWithPassword),都会出现“内部服务器错误”,正如它在账户-ui下拉列表中显示的那样。

我让应用程序工作(我只是已经登录),但是我运行了meteor reset命令以清除数据库,现在它不允许登录。我甚至尝试过Meteor.loginWithToken,使用我在mongo控制台中为用户找到了令牌,但即使这样也无效(仍然是内部服务器错误)。

在服务器上,它显示了一堆“MongoError”异常,这些异常在第一次尝试登录后会定期发出。我尝试使用account-google,但发生了同样的错误。创建帐户时也会发生这种情况,因为它会在之后将您登录(但它会在崩溃之前创建帐户)。同时,客户端控制台显示没有错误(只是页面本身的“内部服务器错误”)。

以下是登录时在服务器上显示的第一条错误消息:

I20130821-10:55:59.266(-4)? Exception from task: MongoError: invalid query
I20130821-10:55:59.335(-4)?     at Object.Future.wait (/Users/efriis/.meteor/tools/4010e5731d/lib/node_modules/fibers/future.js:326:15)
I20130821-10:55:59.336(-4)?     at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:540)
I20130821-10:55:59.336(-4)?     at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:570)
I20130821-10:55:59.336(-4)?     at _.extend.getRawObjects (packages/mongo-livedata/mongo_driver.js:621)
I20130821-10:55:59.336(-4)?     at _.extend._pollMongo (packages/mongo-livedata/mongo_driver.js:897)
I20130821-10:55:59.336(-4)?     at _.extend._addFirstObserveHandle (packages/mongo-livedata/mongo_driver.js:830)
I20130821-10:55:59.338(-4)?     at Meteor.bindEnvironment.runWithEnvironment (packages/meteor/dynamics_nodejs.js:69)
I20130821-10:55:59.338(-4)?     at Object.Meteor.bindEnvironment [as task] (packages/meteor/dynamics_nodejs.js:79)
I20130821-10:55:59.338(-4)?     at _.extend._run (packages/meteor/fiber_helpers.js:144)
I20130821-10:55:59.338(-4)?     at _.extend._scheduleRun (packages/meteor/fiber_helpers.js:122)
I20130821-10:55:59.338(-4)?     - - - - -
I20130821-10:55:59.338(-4)?     at Object.toError (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
I20130821-10:55:59.338(-4)?     at Cursor.nextObject.self.queryRun (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:54)
I20130821-10:55:59.339(-4)?     at Cursor.close (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:903:5)
I20130821-10:55:59.339(-4)?     at Cursor.nextObject.commandHandler (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:21)
I20130821-10:55:59.340(-4)?     at Db._executeQueryCommand (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/db.js:1658:9)
I20130821-10:55:59.340(-4)?     at Server.Base._callHandler (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/base.js:378:41)
I20130821-10:55:59.340(-4)?     at Server.connect.connectionPool.on.server._serverState (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:468:18)
I20130821-10:55:59.340(-4)?     at MongoReply.parseBody (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
I20130821-10:55:59.340(-4)?     at Server.connect.connectionPool.on.server._serverState (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:426:20)
I20130821-10:55:59.340(-4)?     at EventEmitter.emit (events.js:96:17)
I20130821-10:55:59.341(-4)? Exception while invoking method 'login' MongoError: invalid query
I20130821-10:55:59.341(-4)?     at Object.Future.wait (/Users/efriis/.meteor/tools/4010e5731d/lib/node_modules/fibers/future.js:326:15)
I20130821-10:55:59.341(-4)?     at _.extend.runTask (packages/meteor/fiber_helpers.js:79)
I20130821-10:55:59.341(-4)?     at _.extend._addFirstObserveHandle (packages/mongo-livedata/mongo_driver.js:829)
I20130821-10:55:59.342(-4)?     at MongoConnection._observeChanges (packages/mongo-livedata/mongo_driver.js:688)
I20130821-10:55:59.342(-4)?     at Cursor.observeChanges (packages/mongo-livedata/mongo_driver.js:480)
I20130821-10:55:59.342(-4)?     at Function.Meteor.Collection._publishCursor (packages/mongo-livedata/collection.js:232)
I20130821-10:55:59.343(-4)?     at Cursor._publishCursor (packages/mongo-livedata/mongo_driver.js:461)
I20130821-10:55:59.343(-4)?     at _.extend._runHandler (packages/livedata/livedata_server.js:868)
I20130821-10:55:59.343(-4)?     at _.extend._setUserId.self._dontStartNewUniversalSubs (packages/livedata/livedata_server.js:696)
I20130821-10:55:59.343(-4)?     at Function._.each._.forEach (packages/underscore/underscore.js:87)
I20130821-10:55:59.343(-4)?     - - - - -
I20130821-10:55:59.343(-4)?     at Object.Future.wait (/Users/efriis/.meteor/tools/4010e5731d/lib/node_modules/fibers/future.js:326:15)
I20130821-10:55:59.344(-4)?     at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:540)
I20130821-10:55:59.344(-4)?     at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:570)
I20130821-10:55:59.344(-4)?     at _.extend.getRawObjects (packages/mongo-livedata/mongo_driver.js:621)
I20130821-10:55:59.345(-4)?     at _.extend._pollMongo (packages/mongo-livedata/mongo_driver.js:897)
I20130821-10:55:59.345(-4)?     at _.extend._addFirstObserveHandle (packages/mongo-livedata/mongo_driver.js:830)
I20130821-10:55:59.345(-4)?     at Meteor.bindEnvironment.runWithEnvironment (packages/meteor/dynamics_nodejs.js:69)
I20130821-10:55:59.345(-4)?     at Object.Meteor.bindEnvironment [as task] (packages/meteor/dynamics_nodejs.js:79)
I20130821-10:55:59.345(-4)?     at _.extend._run (packages/meteor/fiber_helpers.js:144)
I20130821-10:55:59.346(-4)?     at _.extend._scheduleRun (packages/meteor/fiber_helpers.js:122)
I20130821-10:55:59.346(-4)?     - - - - -
I20130821-10:55:59.346(-4)?     at Object.toError (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
I20130821-10:55:59.346(-4)?     at Cursor.nextObject.self.queryRun (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:54)
I20130821-10:55:59.346(-4)?     at Cursor.close (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:903:5)
I20130821-10:55:59.346(-4)?     at Cursor.nextObject.commandHandler (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:21)
I20130821-10:55:59.347(-4)?     at Db._executeQueryCommand (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/db.js:1658:9)
I20130821-10:55:59.347(-4)?     at Server.Base._callHandler (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/base.js:378:41)
I20130821-10:55:59.347(-4)?     at Server.connect.connectionPool.on.server._serverState (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:468:18)
I20130821-10:55:59.347(-4)?     at MongoReply.parseBody (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
I20130821-10:55:59.347(-4)?     at Server.connect.connectionPool.on.server._serverState (/Users/efriis/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:426:20)
I20130821-10:55:59.348(-4)?     at EventEmitter.emit (events.js:96:17)

我很难过。任何想法?

2 个答案:

答案 0 :(得分:3)

简单的问题,只是没有出现在错误控制台中:

我从服务器发布了一个集合,我错误地使用了$ in运算符。我有两个数组,而不是只使用concat()方法来连接它们。这解决了这个问题。

答案 1 :(得分:0)

要找出导致此类错误的查询,您可以将console.log(this.query)放入QueryCommand.prototype.toBinary~/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/commands/query_command.js功能的任何位置。可以在原始错误消息中查找路径的数字部分(0120179b5c)。

在新的控制台输出中,查询将出现在错误消息之前。

快乐的调试!