Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9936

Better error message when Text search run at database level

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Text Search
    • Labels:
      None
    • Environment:
      Test/Development

      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.

            Assignee:
            matt.kangas Matt Kangas
            Reporter:
            norberto.leite Norberto Fernando Rocha Leite (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: