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

Authentication attempts against arbiter node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.2.25
    • Fix Version/s: 2.2.26
    • Component/s: MongoDB 3.2
    • Labels:
      None

      Description

      Whenever someone attempts to connect to a replica set, the driver tries to authenticate against the arbiter node.

      Test function:

      const MongoClient = require('mongodb').MongoClient;
       
      // Default replica set options 
      var replSetOpts = { 
          ha: true, 
          haInterval: 500, 
          reconnectWait: 5000, 
          poolSize: 5, 
          retries: 10000000, 
          socketOptions: { 
            connectTimeoutMS: 20000, 
            keepAlive: 1, 
            noDelay: true 
          }
      };
       
      const url = "mongodb://<user>:<pass>@primary:secondary/<datasbase>?replicaSet=<rs>"
       
      MongoClient.connect(url, replSetOpts, function(err, db) {
        if(err) {
          console.log('Error: %s', err)
          process.exit(1)
        } 
       
        console.log("Connected correctly to server");
        db.listCollections().toArray(function(err, items) {
          console.log(items);
          db.close();
        });
      });
      
      

      After running the test and successfully connecting, the arbiter is used for authentication:

      2017-04-09T16:22:07.270-0700 I ACCESS [conn244] SCRAM-SHA-1 authentication failed for <user> on <db> from client <IP> ; UserNotFound: Could not find user <user>@<db>

      If I remove haInterval, or increase it to a higher value, the problem seems to be mitigated but still happens, although less often.

      I noticed this bug was filled before, at https://jira.mongodb.org/browse/NODE-927

      Maybe it is still happening on the current version?

      Thanks,
      Victor.

        Attachments

          Activity

            People

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            Vic Victor Martin [X] (Inactive)
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: