-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
NODE-4624 Description
Hello,
I am trying to set up a MongoDB Connection via the node driver. It works as expected when i connect to a regular database, but won't work with a replica set db.
I have tried switching between different mongodb drivers (node) but with no success.
Currently using:
Node v16.17.0
mongodb v4.9.1
ubuntu v22
typescript v4.8.2
const uri = "mongodb://host:27017";
const werden = {
auth:
,
ssl: true,
sslCA: "path/to/self-signedCA",
tlsAllowInvalidCertificates: true,
replicaSet: "rs01",
};
it returns this error:
```
MongoServerSelectionError: getaddrinfo EAI_AGAIN 3d58bb2f4108
at Timeout._onTimeout (....../node_modules/mongodb/lib/sdam/topology.js:293:38)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(1)
,
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'rs01',
maxElectionId: new ObjectId("7fffffff0000000000000016"),
maxSetVersion: 1,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
}
```
- is depended on by
-
NODE-4624 Connection to replicaSet fails
- Closed