Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAPI occasionally sends a malformed query and Mongo closes connection #246
Comments
josephdenne
assigned
jimlambie
Apr 26, 2017
josephdenne
added
the
type: bug
label
Apr 26, 2017
This comment has been minimized.
This comment has been minimized.
@fra967 what is th mongodb version? |
This comment has been minimized.
This comment has been minimized.
MongoDB 3.2.10 (it's a replicaset) |
This comment has been minimized.
This comment has been minimized.
I managed to trace the offending query, which is probably sent by a badly written hook, yet to be identified It's a simple empty _id: If I try to hit API with a similar query, it does not generate the MongoDB error Maybe there is some validation, which doesn't happen when the query is sent directly from the model? |
This comment has been minimized.
This comment has been minimized.
The error originates from a hook that passes API a query containing an ObjectID. API attempts to make this case insensitive and it looks as if a case insensitive ObjectID = "".... The hook can be changed to pass a string in the query instead, as a temporary fix. Two pieces of work:
|
jimlambie
added this to Backlog
in API Version 2
May 31, 2017
jimlambie
modified the milestone:
2.0.0
May 31, 2017
jimlambie
referenced this issue
Jun 2, 2017
Merged
fix: ignore _id field in query when making case insensitive #295
jimlambie
added
the
in progress
label
Jun 2, 2017
jimlambie
moved this from Backlog
to Review
in API Version 2
Jun 3, 2017
This comment has been minimized.
This comment has been minimized.
Closed by d103f62 |
fra967 commentedApr 26, 2017
•
edited
This issue appears occasionally in an API production environment used by Publish
MongoDB log reports an error and the database closes the connection, causing a sequence of API errors and data loss
The error reported by MongoDB is:
Being a live environment, it is difficult to trace which query creates this issue, but it has been seen after PUT or DELETE requests.
Probably the first step would be to introduce verbose logging (with the full content of the request sent to the database) in order to gather more info
API 1.15.5
Node 6.10.2