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
We are seeing an intermittent bug when using Mongoose 4.7.7-pre (1ddadf8) and Node 7.7.1 under heavy load. We have only been able to reproduce it in production and in our staging environment, and only very infrequently.
The bug does not occur under Node 6.10.
It manifests as either "Invalid argument to findOne(): { QUERY CONTENTS }" or as "Invalid select() argument. Must be string or object.", and we have seen it only with very frequently-executed queries, with no other pattern.
The bug seems to lead down to mquery.canMerge and from there to mquery.isObject. We think it is dangerous because most calls to canMerge don't do the same check that findOne does -- that is, they will silently fail to merge the query condition rather than erroring out. That could lead to empty or incomplete find() or update() queries.
We are attempting to get a reliable repro right now, but wanted to give a heads-up and see if anyone else had seen anything like this. We are not suggesting that it is a bug in Mongoose or Mquery necessarily, but this is the only place where it is showing up for us. We intend to test other Mongoose versions when we can reproduce consistently. Currently we are not able to upgrade to Node 7 in production because we cannot reproduce this issue reliably.
Again, we realize this probably isn't enough information to go on, but wanted to post here to see if this rang any bells for the Mongoose contributors. We'll post more as we (hopefully) progress.
The text was updated successfully, but these errors were encountered:
We are seeing an intermittent bug when using Mongoose 4.7.7-pre (1ddadf8) and Node 7.7.1 under heavy load. We have only been able to reproduce it in production and in our staging environment, and only very infrequently.
The bug does not occur under Node 6.10.
It manifests as either "Invalid argument to findOne(): { QUERY CONTENTS }" or as "Invalid select() argument. Must be string or object.", and we have seen it only with very frequently-executed queries, with no other pattern.
The bug seems to lead down to mquery.canMerge and from there to mquery.isObject. We think it is dangerous because most calls to canMerge don't do the same check that findOne does -- that is, they will silently fail to merge the query condition rather than erroring out. That could lead to empty or incomplete find() or update() queries.
It looks as though at least one other person is seeing or has seen the problem: http://stackoverflow.com/questions/42397994/dark-mongoose-magic-invalid-argument-to-findone
We are attempting to get a reliable repro right now, but wanted to give a heads-up and see if anyone else had seen anything like this. We are not suggesting that it is a bug in Mongoose or Mquery necessarily, but this is the only place where it is showing up for us. We intend to test other Mongoose versions when we can reproduce consistently. Currently we are not able to upgrade to Node 7 in production because we cannot reproduce this issue reliably.
Again, we realize this probably isn't enough information to go on, but wanted to post here to see if this rang any bells for the Mongoose contributors. We'll post more as we (hopefully) progress.
The text was updated successfully, but these errors were encountered: