1

基本问题:登录 Meteor 应用程序不起作用,我不知道为什么。

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

我的应用程序正在运行(我只是一直在登录),但是我运行了流星重置命令来清除数据库,现在它不允许登录。我什至尝试使用我找到的令牌 Meteor.loginWithToken在用户的 mongo 控制台中,但即使这样也不起作用(仍然是内部服务器错误)。

在服务器上,它显示了一堆“MongoError”异常,这些异常在第一次尝试登录后会定期发出。我尝试改用accounts-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)

我难住了。有任何想法吗?

4

2 回答 2

3

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

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

于 2013-08-21T16:54:20.613 回答
0

要找出是哪个查询导致了这样的错误,您可以将console.log(this.query)函数QueryCommand.prototype.toBinary放入~/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/commands/query_command.js. 路径的数字部分 ( 0120179b5c) 可以在原始错误消息中查找。

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

调试愉快!

于 2014-06-30T17:02:52.593 回答