Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4625

Investigate NODE-4624 - Connection to replicaSet fails

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 4.10.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 1
    • Not Needed
    • Not Needed

      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:

      { username: "xyz", password: "xyzPW" }

      ,
      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)

      { '3d58bb2f4108:27017' => [ServerDescription] }

      ,
      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) {}
      }
      ```

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            dbeng-pm-bot PM Bot
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: