9

I deployed a meteor app to an AWS server using mup which used docker to deploy the app. I also used mLab sandboxed db.

The issue is, the app crashes without warning after some time. Crashing means the app still works but data won't load from the database. I have two versions of the app (staging and production) running in two different servers. But both have this issue. In the docker logs I see this error repeated a lot of times :

Exception in setInterval callback: MongoError: server instance pool was destroyed
    at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:446:16)
    at MongoConnection.<anonymous> (packages/meteor/helpers.js:119:1)
    at MongoConnection.(anonymous function) [as update] (packages/mongo/mongo_driver.js:771:49)
    at [object Object].update (packages/mongo/collection.js:589:29)
    at AccountsServer.Ap._expireTokens (packages/accounts-base/accounts_server.js:1100:14)
    at packages/accounts-base/accounts_server.js:1173:14
    at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
    at packages/meteor/timers.js:6:1
    at runWithEnvironment (packages/meteor/dynamics_nodejs.js:110:1)
    - - - - -
    at Function.MongoError.create (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:29:11)
    at basicWriteValidations (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:433:51)
    at [object Object].Server.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:543:16)
    at [object Object].Server.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/server.js:386:17)
    at updateDocuments (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1037:19)
    at [object Object].Collection.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1075:44)
    at MongoConnection._update (packages/mongo/mongo_driver.js:560:18)
    at MongoConnection.<anonymous> (packages/meteor/helpers.js:118:1)
    at MongoConnection.(anonymous function) [as update] (packages/mongo/mongo_driver.js:771:49)
    at [object Object].update (packages/mongo/collection.js:589:29)

Any idea what's happening?

In the client browser console, I see this error:

WebSocket connection to 'wss://oursite.com/sockjs/373/2lrpal10/websocket' failed: WebSocket is closed before the connection is established.

MasterAM
  • 16,283
  • 6
  • 45
  • 66
THpubs
  • 7,804
  • 16
  • 68
  • 143
  • Similar question? http://stackoverflow.com/questions/39029893/why-is-the-mongodb-node-driver-generating-instance-pool-destroyed-errors – CodeChimp Sep 22 '16 at 12:37
  • @codechimp i don't think so. In there they have manually connected mongo. But in my case meteor does everything. So i can't fix it they way its fixed in there – THpubs Sep 22 '16 at 12:45
  • it sounds like Mongo has crashed - you might need to look at the Mongo logs for a clue – Mikkel Sep 26 '16 at 20:16
  • Are you running something in `setInterval`? If so, what is it? Do you have anything unique in your AWS setup? an ELB? Do you use ECS for your docker containers or just running on EC2? – gkrizek Sep 28 '16 at 20:32
  • Same problem here, but I am developing localy on my machine. Win-7 64bit machine. – Sysrq147 Oct 08 '16 at 15:59

1 Answers1

3

Updating npm-mongo and mongo fixed this for me.

meteor update --all-packages
andypopa
  • 536
  • 6
  • 15