2013-08-21 245 views
1

基本問題:登錄到流星應用程序不工作,我不知道爲什麼。流星帳戶不工作

我有一個使用帳戶密碼包的流星應用程序,但每當我嘗試登錄時(無論是使用accounts-ui下拉列表還是通過調用Meteor.loginWithPassword),都有一個「內部服務器錯誤「,因爲它顯示在accounts-ui下拉菜單中。

我有應用程序工作(我只是總是已經登錄),但我運行流星重置命令清除數據庫,現在它不允許登錄。我甚至嘗試使用Meteor.loginWithToken,使用我在mongo控制檯爲用戶找到的令牌,但即使這樣也行不通(仍然是內部服務器錯誤)。

在服務器上,它顯示了一堆「MongoError」異常,它們會在第一次嘗試登錄後周期性地發出。我嘗試使用帳戶谷歌,而不是相同的錯誤發生。創建帳戶時也會發生這種情況,因爲它會在以後登錄(但它確實會在創建帳戶之前崩潰)。同時,客戶端控制檯顯示沒有錯誤(只是頁面本身的「內部服務器錯誤」)。

下面是在服務器上顯示登錄時的第一個錯誤信息:

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) 

我難倒。有任何想法嗎?

回答

3

簡單的問題,只是沒有在錯誤控制檯顯示:

我是從服務器發佈的集合,我在運營商使用的$不當。我有兩個數組,而不是僅僅使用concat()方法來加入它們。這解決了這個問題。

0

要找出哪個查詢導致了這樣的錯誤,您可以將console.log(this.query)放入~/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/commands/query_command.jsQueryCommand.prototype.toBinary函數的任意位置。路徑的編號部分(0120179b5c)可以在原始錯誤消息中查找。

在新的控制檯輸出中,查詢將顯示在錯誤消息之前。

快速調試!