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 primary found in replicaset" when trying to connect to IBM cloud database after migration from Compose.io #12224

Open
nsiegmundtol opened this issue Oct 14, 2022 · 3 comments

Comments

@nsiegmundtol
Copy link

nsiegmundtol commented Oct 14, 2022

I have read through all the solutions on this issue and none have seemed to help: #7450

I have successfully gotten our .Net applications to connect to our new ibm hosted mongo DB, but am getting an error whenever i try with meteor locally or through our galaxy server:


2022-10-14 11:00:53-04:00 MongoError: no primary found in replicaset
2022-10-14 11:00:53-04:00  at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
2022-10-14 11:00:53-04:00  at new MongoConnection (packages/mongo/mongo_driver.js:211:27)
2022-10-14 11:00:53-04:00  at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
2022-10-14 11:00:53-04:00  at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
2022-10-14 11:00:53-04:00  at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
2022-10-14 11:00:53-04:00  at new Mongo.Collection (packages/mongo/collection.js:99:40)
2022-10-14 11:00:53-04:00  at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
2022-10-14 11:00:53-04:00  at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
2022-10-14 11:00:53-04:00  at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
2022-10-14 11:00:53-04:00  at fileEvaluate (packages/modules-runtime.js:197:9)

Here is the current way i am calling my connection string with a "npm run win-start" command defined in our package.json:

"win-start": "SET MONGO_URL=mongodb://admin:[PASSWORD]@url1.databases.appdomain.cloud:31928,url2.databases.appdomain.cloud:31928,url3.databases.appdomain.cloud:31928/dyo?authSource=admin^&tls=true^&tlsInsecure=true^&connect=replicaSet^&replicaSet=replset && meteor --settings settings.json"

(notice the ^&, thats the only way i could escape the ampersands and get the command to not error out. maybe that's part of the problem)

even trying to connect to our old compose server locally throws this same error. Any help is appreciated

  • MongoDB Version: 4.4
  • Meteor Version: 1.4.4.1
@radekmie
Copy link
Collaborator

Meteor 1.4.4.1 uses MongoDB driver 2.2.24 (it was updated in 1.4.3.2), and the latest MongoDB version it supports is 3.4. You'd have to update to at least Meteor 1.11 (driver 3.6).

@nsiegmundtol
Copy link
Author

Meteor 1.4.4.1 uses MongoDB driver 2.2.24 (it was updated in 1.4.3.2), and the latest MongoDB version it supports is 3.4. You'd have to update to at least Meteor 1.11 (driver 3.6).

So I did manage to get the connection to work, but by adding ssl equal to true in the parameters, which idk why that fixed it and I think it might be deprecated? Also, our compose db was running on 4.0 mongo db and everything was working just fine with meteor.

So do you think I’m good for the time being or are things going to bite us in the butt here soon?

@radekmie
Copy link
Collaborator

Well, MongoDB is rather safe to use with an unsupported version in most cases, and the table I linked shows "full compatibility", i.e., it may work, but some features may be unavailable (because the driver doesn't understand them or the database no longer supports them).

Now, being realistic, these versions are really old, and nobody will ever touch it, so if it works, it most likely will indefinitely for a long time. I think it's fine as long as you test it thoroughly.

@radekmie radekmie self-assigned this Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants