0

I have mongodb setup as standalone server. I also have replicaset enabled as standalone for enabling the oplog (my app tracks realtime updates).

This setup works fine. But randomly I get the error message no valid seed servers in list with connect-mongo throwing this error.

d:\Nodevue\nvweb\node_modules\connect-mongo\node_modules\mongodb\lib\mongo_clien t.js:393 throw err ^ MongoError: no valid seed servers in list

This is my connect-mongo connection string:

{
  "url": "mongodb://localhost/dbname",
  "autoReconnect": true,
  "mongoOptions": {
    "server": {
      "auto_reconnect": true,
      "poolSize": 20,
      "socketOptions": {
        "keepAlive": 1,
        "connectTimeoutMS": 10000
      }
    },
    "replset": {
      "socketOptions": {
        "keepAlive": 1,
        "connectTimeoutMS": 10000
      }
    }
  }
}

Any solutions?

user3658423
  • 1,904
  • 5
  • 29
  • 49
  • Please edit your answer and provide the configuration of your MongoDB server with the command-line arguments you have used. Also, please show the output of `rs.conf()`. – Dmytro Shevchenko Nov 18 '15 at 11:10
  • Also, try adding the name of your replica set at the end of the url: `"url": "mongodb://localhost/dbname?replicaSet=yourReplicaSetName"` – Dmytro Shevchenko Nov 18 '15 at 11:19

0 Answers0