Skip to content Skip to sidebar Skip to footer

Mongoerror: Topology Was Destroyed Sailsjs

When I try to create this error shows up: Error (E_UNKNOWN) :: Encountered an unexpected error MongoError: topology was destroyed at Server.insert (/Users/oscargallon/Docu

Solution 1:

I also encountered this same problem today - i changed the sails-mongo version from "sails-mongo": "^0.10.7" to "sails-mongo": "^0.10.6" in package.json in sails and ran $ sudo npm install then sails lift it worked fine i think there is some error in npm

Solution 2:

Sails-mongo v0.10.7 introduced a breaking change and doesn't support mongo <= 2.4. The breaking change has been reverted and v0.10.8 was published restoring compatibility with mongo <= 2.4. Meanwhile v0.10.7 has been deprecated.

Simultaneously v0.11 has been released which is compatible with mongo >= 2.6.

For those using mongo <= 2.4 do not update to 0.11.x.

UPDATE: some users reported problems with Mongo 3.0 and using v0.10.8 seems to have fixed the issue for them: more details.

UPDATE 2: The issue with v0.10.7 and v0.11.0-1 has been traced to inappropriate connection configurations (PR #277). This can be fixed locally by adjusting the connection config (sails/config/connections.js file for sails users):

devMongodbServer: { //connectionnameport:27017,
    database:'dev-mongodb-server',
    poolSize:5,
    socketOptions: {
        noDelay:true,
        connectTimeoutMS:0,
        socketTimeoutMS:0
    }
}

v0.11.2 will be released with this connection config as default.

More details on https://github.com/balderdashy/sails-mongo/issues/266

Solution 3:

As mentioned by Anandapriyan, it caused by 0.10.7 sail-mongo. The solution doesn't work for me but inspired me. I re-install sail-mongo with a elder build. and it works.

sudo npm install sails-mongo@0.10.6--save

I've tried 0.10.4 but I got another error. So just user 0.10.6

error: A hook (`orm`) failed to load!

Post a Comment for "Mongoerror: Topology Was Destroyed Sailsjs"