-
Type: Bug
-
Resolution: Won't Fix
-
Priority: 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
-
Empty show more show less
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).