[SERVER-9936] Better error message when Text search run at database level Created: 14/Jun/13  Updated: 25/Jun/15  Resolved: 11/Jan/15

Status: Closed
Project: Core Server
Component/s: Text Search
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Norberto Fernando Rocha Leite (Inactive) Assignee: Matt Kangas
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Test/Development


Participants:

 Description   

By accident I've invoked on database level and not on collection level.
and I got the following error message:

>db.runCommand( 'text', {search: 'some text'}) 
{
	"errmsg" : "exception: wrong type for field (text) 1 != 2",
	"code" : 13111,
	"ok" : 0
}

and log stack dump

Fri Jun 14 16:03:56.491 [conn1] Assertion: 13111:wrong type for field (text) 1 != 2
0x10ff79d3b 0x10ff5392e 0x10ff539ed 0x10fc3e239 0x10fb68e69 0x10fcbc774 0x10fc7c905 0x10fc7d82c 0x10fc7e0e5 0x10fd7503e 0x10fd75841 0x10fd237bf 0x10fb46fa2 0x10ff6f7d9 0x10ffac645 0x7fff8fe647a2 0x7fff8fe511e1
 0   mongod                              0x000000010ff79d3b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x000000010ff5392e _ZN5mongo11msgassertedEiPKc + 174
 2   mongod                              0x000000010ff539ed _ZN5mongo11msgassertedEiRKSs + 29
 3   mongod                              0x000000010fc3e239 _ZNK5mongo11BSONElement3chkEi + 793
 4   mongod                              0x000000010fb68e69 _ZNK5mongo11BSONElement6StringEv + 41
 5   mongod                              0x000000010fcbc774 _ZN5mongo3fts10FTSCommand3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 162
 6   mongod                              0x000000010fc7c905 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37
 7   mongod                              0x000000010fc7d82c _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2516
 8   mongod                              0x000000010fc7e0e5 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1013
 9   mongod                              0x000000010fd7503e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
 10  mongod                              0x000000010fd75841 _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1553
 11  mongod                              0x000000010fd237bf _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1519
 12  mongod                              0x000000010fb46fa2 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 198
 13  mongod                              0x000000010ff6f7d9 _ZN5mongo17PortMessageServer17handleIncomingMsgEPv + 1657
 14  mongod                              0x000000010ffac645 thread_proxy + 229
 15  libsystem_c.dylib                   0x00007fff8fe647a2 _pthread_start + 327
 16  libsystem_c.dylib                   0x00007fff8fe511e1 thread_start + 13

Would be nice to have a check in place for this command before to avoid throwing this stack trace.

N.



 Comments   
Comment by Matt Kangas [ 11/Jan/15 ]

The "text" command was removed in SERVER-16061. The scenario described won't happen with a $text query.

Generated at Thu Feb 08 03:21:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.