Closed sunshineo closed 3 years ago
I believe this has been fixed in the latest version of the mongo driver.
https://jira.mongodb.org/browse/NODE-2784
We are looking into updating the driver.
Here are some workaround suggestions:
readPreference
from the connection string and instead set it in the Parse Server configuration as driver option. Untested.readPreference
as option of the Parse Query where you want to override the driver / connection string read preference. Untested.I tried that. Same problem.
On Wed, Dec 9, 2020 at 10:08 AM Manuel notifications@github.com wrote:
A workaround may be - I haven't tested it - to remove the readPreference from the connection string and instead set it in the Parse Server configuration as driver option.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/parse-server/issues/7048#issuecomment-741952717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIF47TTJGNMSGM5HCVEBL3ST64LRANCNFSM4URFMBNQ .
@mtrezza manually create the index in the DB does not work. As a matter of fact, when I test removed the readPrefrence settings, it worked and created the index. But when add back the readPreference, code probably is trying to ensure index exists and still fails even the index is already there
manually create the index in the DB does not work.
I cannot reproduce this with an existing Parse Server deployment by adding readPreference=secondaryPreferred
to the connection string. The server works just fine.
@mtrezza is your DB a cluster with 3 nodes (mine on MongoDB Atlas)?
Yes, I tried it with a 3 node (PSS) replica set. Just to be sure I also tried to use the exactly same connection string parameters as yours, still works. Maybe you want to post the created index?
You could also try to upgrade the Parse Server mongodb dependency to 3.6.3.
Upgrade to 3.6.3 definitely works. I guess I have to install from my repo for a while. I'm creating a PR
I reopened the issue because it still exists and the PR has not been merged yet.
New Issue Checklist
Issue Description
When Mongo URI has readPreference set to secondaryPreferred (and connecting to a Mongo Atlas cluster) we get the following error:
Steps to reproduce
Create a cluster with 3 nodes on MongoDB Atlas. I feel a cluster anywhere can reproduce
Environment
Server
Database
Logs