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

MongoClient.connect hangs occasionally

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.2.33, 2.2.34
    • Component/s: None
    • Labels:
    • Environment:
      node v6.10
      typescript, run via ts-node
      mongodb-core 2.1.19
      mongodb 2.2.35

      Hello,

      I am attempting to connect to mongodb using the following code

      import * as mongodb from 'mongodb';
      console.log('Attempting connection...');
      const dbPromise = mongodb.MongoClient.connect(mongodbUrl);
      dbPromise.then(() => {
        console.log('connected!');
      });
      

      I am on node v6.10, and started with the following libraries:

      mongodb-core 2.1.17
      mongodb 2.2.33
      

      When running the above code, I would intermittently get the following error:

      (node:76520) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): MongoError: no connection available
      

      In the process of trying to address this issue, I upgraded my driver:

      mongodb-core 2.1.19
      mongodb 2.2.35
      

      Now, the connection promise neither fails nor resolves. I ran this with `loggingLevel: 'debug'`, and got the output in mongolog.txt (attached).

        1. mongolog.txt
          361 kB
          Denis Lantsman

            Assignee:
            Unassigned Unassigned
            Reporter:
            denis@desmos.com Denis Lantsman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: