[SERVER-477] Repeatedly seeing "Assertion: no index found for specified keyPattern" in the logs Created: 11/Dec/09  Updated: 07/Mar/14  Resolved: 12/Dec/09

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.1.4
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Andrews Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

64-bit Linux. 2.6.18-164.6.1.el5 kernel.


Attachments: Text File indexes.txt     Text File logs.txt     Text File schema.txt    
Participants:

 Description   

I discussed this with Eliot on IRC, and he recommended I post the data here. Here is a specific example of the assertion we are seeing repeatedly in the logs:

Fri Dec 11 20:17:37 Assertion: no index found for specified keyPattern
Fri Dec 11 20:17:37 ntoskip:0 ntoreturn:500
Fri Dec 11 20:17:37 query:{ query: { minutes.velocity24:

{ $gt: 0 }

}, $max:

{ limit: 500 }

, orderby:

{ minutes.velocity24: -1 }

}

The attached logs.txt file shows other examples, however the above is the only one that I know for certain is happening in the collection for which I've attached a schema and the indexes.



 Comments   
Comment by Doug Green [ 12/Dec/09 ]

There are two problems here, both of them mine, and none of them Mongo's. I realized yesterday (before Jeremy submitted this that the max was wrong. I was trying to make it do a limit() from c++ and it didn't seem to be honoring the DBClientCursor::query() argument. I'm hoping that it really is honoring the argument and that the log Jeremy saw earlier was just wrong. Anyways, I removed the Query::maxKey().

The second problem is that, yes, the index is missing because this query is on the wrong field name, it should be hours.velocity24, not minutes.velocity24.

You can close this issue. Sorry for bothering you.

Comment by Eliot Horowitz (Inactive) [ 11/Dec/09 ]

are you adding that $max manually? $max shouldn't be being used in that way.
can you send the code that's generating that query?

Generated at Thu Feb 08 02:54:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.