You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am executing aggregation query on mongodb as soon as connection established.
but I am getting below issue sometimes and sometimes query get executed successfully
some people facing same issue but while dropping db 4490
I am attaching stack trace :
(node:1) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to
(node:1) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
**TypeError: Cannot read property 'commandsTakeWriteConcern' of null
File "/srv/slingshot/node_modules/mongoose/node_modules/mongodb/lib/operations/aggregate.js", line 53, col 52, in aggregate
const takesWriteConcern = topology.capabilities().commandsTakeWriteConcern;
File "/srv/slingshot/node_modules/mongoose/node_modules/mongodb/lib/collection.js", line 1694, col 10, in Collection.aggregate
return aggregate(this.s.db, this, pipeline, options, callback);
File "/srv/slingshot/node_modules/newrelic/lib/shim/shim.js", line 946, col 24, in Collection.wrapper [as aggregate]
return fnApply.call(fn, this, arguments)
File "/srv/slingshot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js", line 146, col 28, in NativeCollection.(anonymous function) [as aggregate]
return collection[i].apply(collection, args);
File "/srv/slingshot/node_modules/mongoose/lib/collection.js", line 126, col 30, in NativeCollection.Collection.doQueue
this[this.queue[i][0]].apply(this, this.queue[i][1]);
File "/srv/slingshot/node_modules/mongoose/lib/collection.js", line 86, col 24, in immediate
immediate(() => this.doQueue());
File "internal/process/next_tick.js", line 70, col 11, in process.internalTickCallback
I am not able to write exact steps to reproduce issue, as it occurring randomly.
can anyone provide me help regarding this issue, what could be reason for issue ?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Not much I can really do about this issue without seeing some of your code, but here's a few suggestions for what you can do:
Make sure you wait for mongoose.connect() to succeed before executing your aggregate() call, using mongoose.connect().then(cb) or await mongoose.connect()
Try running without New Relic. New Relic does a lot of monkeypatching and has been known to cause bugs with MongoDB.
Upgrade to Mongoose 5.7, which no longer has the offending code.
vkarpov15
removed
needs repro script
Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
labels
Oct 7, 2019
mongoose version: 5.5.0
I am executing aggregation query on mongodb as soon as connection established.
but I am getting below issue sometimes and sometimes query get executed successfully
some people facing same issue but while dropping db
4490
I am attaching stack trace :
(node:1) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to
(node:1) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
**TypeError: Cannot read property 'commandsTakeWriteConcern' of null
File "/srv/slingshot/node_modules/mongoose/node_modules/mongodb/lib/operations/aggregate.js", line 53, col 52, in aggregate
const takesWriteConcern = topology.capabilities().commandsTakeWriteConcern;
File "/srv/slingshot/node_modules/mongoose/node_modules/mongodb/lib/collection.js", line 1694, col 10, in Collection.aggregate
return aggregate(this.s.db, this, pipeline, options, callback);
File "/srv/slingshot/node_modules/newrelic/lib/shim/shim.js", line 946, col 24, in Collection.wrapper [as aggregate]
return fnApply.call(fn, this, arguments)
File "/srv/slingshot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js", line 146, col 28, in NativeCollection.(anonymous function) [as aggregate]
return collection[i].apply(collection, args);
File "/srv/slingshot/node_modules/mongoose/lib/collection.js", line 126, col 30, in NativeCollection.Collection.doQueue
this[this.queue[i][0]].apply(this, this.queue[i][1]);
File "/srv/slingshot/node_modules/mongoose/lib/collection.js", line 86, col 24, in immediate
immediate(() => this.doQueue());
File "internal/process/next_tick.js", line 70, col 11, in process.internalTickCallback
I am not able to write exact steps to reproduce issue, as it occurring randomly.
can anyone provide me help regarding this issue, what could be reason for issue ?
Thanks in advance.
The text was updated successfully, but these errors were encountered: