othiym23 / async-listener

polyfill version of the 0.11 version of the asyncListener API
https://www.npmjs.org/package/async-listener
BSD 2-Clause "Simplified" License
174 stars 52 forks source link

Node 7.7.2 MongoDB error #99

Closed vmarchaud closed 7 years ago

vmarchaud commented 7 years ago

Hello !

A dependency of pmx require async-listener, we got an issue over PM2 because of async-listener patching errors, i'm just opening an issue over here to see if you can check whats going on ?

NODE: 7.7.2
MongoDB: 2.2.24

TypeError: "listener" argument must be a function
at Socket.once (events.js:307:11)
at Socket.connect (net.js:943:10)
at Socket.connect (/usr/lib/node_modules/pm2/node_modules/async-listener/index.js:76:27)
at Object.exports.connect.exports.createConnection (net.js:76:35)
at Connection.connect (/var/nodes/site.com/node_modules/mongodb-core/lib/connection/connection.js:397:11)
at Pool.connect (/var/nodes/site.com/node_modules/mongodb-core/lib/connection/pool.js:638:16)
at Server.connect (/var/nodes/site.com/node_modules/mongodb-core/lib/topologies/server.js:383:17)
at Server.connect (/var/nodes/site.com/node_modules/mongodb/lib/server.js:361:17)
at open (/var/nodes/site.com/node_modules/mongodb/lib/db.js:226:19)
at Db.open (/var/nodes/site.com/node_modules/mongodb/lib/db.js:249:44)

Solution:
After downgrading to Node 7.7.1, my applications through PM2 was able to connect to the DB again.
vhain commented 7 years ago

this is bug on Node 7.7.2 side. It's not working as expected as doc. Will be fixed by https://github.com/nodejs/node/pull/11762

vmarchaud commented 7 years ago

Thanks for the explanation :)

ghost commented 5 years ago

Meet this bug on node v8.9.0