deno_mongo uses replica information from primary instead of URL
See original GitHub issueWe have a replica set on MongoDB configured with hosts set in the /etc/hosts file which don’t exist on our development machines. When using a URL with the actual domains that are public, deno_mongo uses the information from the primary server instead of the URL. This is not the behaviour we get with Node’s MongoDB or with MongoDB Compass (which both use the servers in the connection URL).
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: ServerSelectionError { message: "Server selection timeout: No available servers. Topology: { Type: ReplicaSetNoPrimary, Servers: [ { Address: premid:27017, Type: Unknown, Error: The supplied Host is unknown. (os error 11001) }, { Address: premid2:27017, Type: Unknown, Error: The supplied Host is (os error 11001) }, { Address: premid3:27017, Type: Unknown, Error: The supplied Host is (os error 11001) }, ] }" } }', src\command\find.rs:41:26
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Replica Set Primary — MongoDB Manual
The primary is the only member in the replica set that receives write operations. ... Then the secondaries replicate the oplog to apply...
Read more >MongoDB Connection String to Replica Set - Stack Overflow
In my experience, the problem isn't when "the primary goes down or is very busy" that is the problem with just specifying the...
Read more >MongoDB Replica Set: 3 Easy Methods to Replicate Data
A complete walkthrough of the content will help you develop the skill to set up MongoDB Replica Sets using various methods.
Read more >Shouldn't mongoose detect primary in a replica set? #2089
I'm using a replica set with one primary and one secondary (hosted by MongoHQ) and connecting using mongoose.connect('mongodb://user:pass@hello.com:12345/my_db, ...
Read more >mongo@v0.31.1 - Deno
... mechanism: "SCRAM-SHA-1", }, }); // Connect using srv url await client.connect( ... atlas_sdk TypeSafe MongoDB Atlas Data API SDK for Deno &...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Until this issue is fixed, use this as a temporary solution (Windows only):
C:\Windows\System32\drivers\etc\hostsin a text editor of your choiceipconfig /flushdnsin a terminalI have the same problem also without replica. Is it possible to set the “moongose” option { useUnifiedTopology: true } in the connection?