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

Unable to Connect to Hosts Other Than localhost

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.4.9
    • Component/s: None
    • Labels:

      This is on Windows, with Git Bash. Even though I have a couple Linux machines, something is messed up in them so I couldn't test there.

      I'm trying to connect to hosts specified in my "hosts" file (dev machine). I am able to make a mongo server on these hosts with mongod (e.g. "mongod --bind_ip example"), and connect with the appropriate mongo shell command (e.g. "mongo --host example"). However, I am unable to connect with the mongo driver for node. Some example input/output:

      mongoclient = require('mongodb').MongoClient;
      mongoclient.connect('example', function(err, db) {
      if(err) console.log(err);
      else console.log(db);
      });
      undefined
      // after a couple seconds
      [Error: failed to connect to [example:27017]]

      What am I doing wrong? Is the mongo driver not waiting long enough or something? Or is this an actual bug?

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            seanrmoran Sean Moran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: