Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MongoError: no valid replicaset members found" error raised after migration from mLab deployment to MongoDB Atlas deployment #6216

Closed
grassland-curing-cfa opened this issue Nov 15, 2019 · 4 comments

Comments

@grassland-curing-cfa
Copy link

Issue Description

Due to mLab acquisition by MongoDB, all mLab deployments are required to be migrated onto MongoDB Atlas. I have a Sandbox deployment in mongod version: 3.6.12 (MMAPv1). After I migrated it to a M0 Cluster on Atlas. My Parse-server (version 2.2.5) application deployed on Heroku cannot be started up due to: "MongoError: no valid replicaset members found".

Steps to reproduce

  1. Create a free M0 Cluster and MongoDB 4.0 database on MongoDB Atlas, and obtain the connection string,
  2. Deploy a Parse-server version 2.2.5 onto Heroku,
  3. Set the connection string as config variable on Heroku.
  4. Create a HelloWorld Cloud function and print out "Hello World"
  5. Connect to Parse-server using cURL and trigger the HelloWorld Cloud function.

Expected Results

"Hello World" is printed

Actual Outcome

The back-end Heroku logs the following msg:

Nov 14 16:20:09 nemp-wa-dev app/web.1: error: Error generating response. { MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: name: 'MongoError',
Nov 14 16:20:09 nemp-wa-dev app/web.1: message: 'no valid replicaset members found' } name=MongoError, message=no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: error: Uncaught internal server error. { MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: name: 'MongoError',
Nov 14 16:20:09 nemp-wa-dev app/web.1: message: 'no valid replicaset members found' } MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.2.25
    • Operating System: Linux on Heroku
    • Hardware: n/a
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
  • Database

    • MongoDB version: mongod version: 3.6.12 (MMAPv1)
    • Storage engine: Sandbox
    • Hardware: n/a
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

Logs/Trace

Nov 14 16:20:09 nemp-wa-dev app/web.1: error: Error generating response. { MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: name: 'MongoError',
Nov 14 16:20:09 nemp-wa-dev app/web.1: message: 'no valid replicaset members found' } name=MongoError, message=no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: error: Uncaught internal server error. { MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: name: 'MongoError',
Nov 14 16:20:09 nemp-wa-dev app/web.1: message: 'no valid replicaset members found' } MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: MongoError: no valid replicaset members found
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timeout._onTimeout (/app/node_modules/mongodb-core/lib/topologies/replset.js:660:33)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at ontimeout (timers.js:386:14)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at tryOnTimeout (timers.js:250:5)
Nov 14 16:20:09 nemp-wa-dev app/web.1: at Timer.listOnTimeout (timers.js:214:5)

@dplewis
Copy link
Member

dplewis commented Nov 15, 2019

Can you update to the latest version of parse server? The MongoDB driver probably addressed this issue.

@grassland-curing-cfa
Copy link
Author

Thanks for the prompt answer.
The M0, M2 and M5 Cluster on Atlas only supports MongoDB 4.0.
I am hesitant to update Parse-server to the latest version as my Heroku application is about three year old. Have you had any idea what is the lowest version of Parse-server that supports MongoDB 4.0?

@dplewis
Copy link
Member

dplewis commented Nov 15, 2019

It’s when 3.1.0 of the mongo driver was added

#4855

Looking at the date you could get away with 2.8.4.

We highly recommend updating to the latest version.

@grassland-curing-cfa
Copy link
Author

Thanks so much. I upgraded to 2.8.4 and MongoDB 4.0 started to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants