Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The console keeps saying an error and make my app to restart
If the current behavior is a bug, please provide the steps to reproduce.
My app starts, eventually, my console keeps saying:
/rbd/pnpm-volume/2c61ee42-4a04-4a21-b074-65934d0afc88/node_modules/.registry.npmjs.org/mongodb-core/3.2.4/node_modules/mongodb-core/lib/error.js:22
super(message.message || message.errmsg || message.$err || 'n/a');
^
TypeError: Cannot read property 'message' of undefined
at new MongoError (/rbd/pnpm-volume/2c61ee42-4a04-4a21-b074-65934d0afc88/node_modules/.registry.npmjs.org/mongodb-core/3.2.4/node_modules/mongodb-core/lib/error.js:22:23)
at new MongoNetworkError (/rbd/pnpm-volume/2c61ee42-4a04-4a21-b074-65934d0afc88/node_modules/.registry.npmjs.org/mongodb-core/3.2.4/node_modules/mongodb-core/lib/error.js:60:5)
at TLSSocket.err (/rbd/pnpm-volume/2c61ee42-4a04-4a21-b074-65934d0afc88/node_modules/.registry.npmjs.org/mongodb-core/3.2.4/node_modules/mongodb-core/lib/connection/connect.js:287:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket.Socket._onTimeout (net.js:422:8)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
What is the expected behavior?
No errors displayed
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
There's some interested nuances to your setup. It looks like you're using SSL - do you have a self-hosted SSL instance or are you connecting to Atlas?
Also, what are you using to install Mongoose? The node_modules/.registry.npmjs.org/mongodb-core/3.2.4/node_modules
path doesn't look quite like a vanilla npm install
...
My app is hosted on glitch, I use the atlas connection. I think glitch uses a different way for using node. (pnpm I think)
My app was working fine, but one day started to fail, so don't know
Same is happening with me and it started all of a sudden. I was able to fix it on the server by removing node_modules and installing again. However, it is not working in CircleCi, even if I clear the cache.
/home/ubuntu/xseed-backend/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:22
super(message.message || message.errmsg || message.$err || 'n/a');
^
TypeError: Cannot read property 'message' of undefined
at new MongoError (/home/ubuntu/xseed-backend/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:22:23)
at new MongoNetworkError (/home/ubuntu/xseed-backend/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:60:5)
at Socket.err (/home/ubuntu/xseed-backend/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connect.js:287:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at Socket._onTimeout (net.js:407:8)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
node: 8.4.0
mongo: 3.4.4
mongoose: 5.5.8
Same issue with me too, I use following packages,
Node: v11.0.0
mongoose: 5.5.8
mongodb: 3.2.4
Figured that it works fine in mongoose: 5.5.0. So I am using this build for now.
Also getting this on:
Node: v10.15.3
mongoose: 5.5.8
mongodb: 3.2.6
Rolled back to 5.5.4 and that seemed to work.
@vkarpov15 I guess this is an underlying library issue and is fixed but is not released yet.
Introduced by https://github.com/mongodb-js/mongodb-core/commit/380a3867fd585afc51d54b4fd32c42b08eeb5a66 (3.2.4)
Fixed in https://github.com/mongodb-js/mongodb-core/commit/83e224be0727438697a2bae3b01af381ab6efe90 (not released yet 3.2.5)
Now I can confirm, using mongoose 5.5.0 fixes it
This fix in package.json works for us:
"resolutions": {
"mongodb-core": "3.2.3"
}
Is the issue fixed ? I got this error today while running a tutorial using mongodb on Mac . So , rolled back mongoose to 5.5.4 as suggested by @Fonger .
I am seeing the issue with version 5.5.9 in an AWS Lambda environment.
mongoose 5.5.10 has been released and the underlying library was updated in this version. Try upgrading to see if it works.
This looks fixed for me. Thank you.
Most helpful comment
mongoose 5.5.10 has been released and the underlying library was updated in this version. Try upgrading to see if it works.