我在 Heroku 上托管我的流星应用程序,并添加了 MongoLab(所有免费计划)。随着时间的推移,应用程序将失败。我将无法登录(使用帐户包),不断收到Internal server error
回复,没有其他有用的消息。要解决此问题,我需要使用heroku ps:restart
.
但是在服务器端记录了这些错误
2013-05-10 01:27:13.530748+00:00 app web.1 - - Exception in queued task: Error: failed to connect to [xxx.mongolab.com:41357] at Object.Future.wait (/app/.meteor/local/build/server/node_modules/fibers/future.js:322:15) at _.extend._nextObject (app/packages/mongo-livedata/mongo_driver.js:485:47) at _.extend.forEach (app/packages/mongo-livedata/mongo_driver.js:506:22) at _.extend.getRawObjects (app/packages/mongo-livedata/mongo_driver.js:550:12) at _.extend._pollMongo (app/packages/mongo-livedata/mongo_driver.js:821:46) at Object._.extend._unthrottledEnsurePollIsScheduled [as task] (app/packages/mongo-livedata/mongo_driver.js:765:12) at _.extend._run (app/packages/meteor/fiber_helpers.js:126:18) at _.extend._scheduleRun (app/packages/meteor/fiber_helpers.js:104:14) EXCEPT
2013-05-10 01:27:13.530748+00:00 app web.1 - - - - - - - Heroku/auction-app
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Server.connect.connectionPool.on.server._serverState (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/server.js:564:74)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at EventEmitter.emit (events.js:126:20)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at connection.on._self._poolState (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:124:15)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at EventEmitter.emit (events.js:99:17)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket.errorHandler (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/connection.js:465:10)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket.EventEmitter.emit (events.js:96:17)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket._destroy.self.errorEmitted (net.js:329:14)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Server.connect.connectionPool.on.server._serverState (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/server.js:564:74) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at EventEmitter.emit (events.js:126:20) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at connection.on._self._poolState (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:124:15) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at EventEmitter.emit (events.js:99:17) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket.errorHandler (/app/.meteor/local/build/server/node_modules/mongodb/lib/mongodb/connection/connection.js:465:10) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket.EventEmitter.emit (events.js:96:17) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at Socket._destroy.self.errorEmitted (net.js:329:14) Heroku/auction-app Context
2013-05-10 01:27:13.531106+00:00 app web.1 - - at process.startup.processNextTick.process._tickCallback (node.js:244:9) Heroku/auction-app
似乎错误是由于无法连接到数据库。但这并没有解释为什么我必须重新启动应用程序,而不是数据库(在 MongoLab 结束)。