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

Aggregation fails with ambiguous assertion when applied to a collection with forbidden BSON types

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.1
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      If you run aggregate on a collection containing one of the following fields

      • MinKey
      • MaxKey
      • EOO
      • Undefined
      • DBRef
      • Code

      Example:

      > db.foo.insert( { x : MinKey } )
      > db.foo.find()
      { "_id" : ObjectId("4f3ad5dc7302cfae80686b02"), "x" : { $minKey : 1 } }
      > db.foo.aggregate( { $project: { x : 1 } } )
      {
      	"errmsg" : "exception: assertion src/mongo/db/pipeline/value.cpp:183",
      	"code" : 0,
      	"ok" : 0
      }

      Server output:

      Tue Feb 14 16:46:11 [conn1]  local.foo Assertion failure false src/mongo/db/pipeline/value.cpp 183
      0x100154641 0x10062a92d 0x100259696 0x100259b22 0x10019e356 0x10019e972 0x1006440d8 0x1006442e5 0x10024e55d 0x10014ba9c 0x1003d0a99 0x10030a804 0x10030d0f4 0x10030fa27 0x1001fb544 0x1001fd83f 0x1001d619e 0x1001dfbc6 0x1000206a4 0x100275c70 
       0   mongod                              0x0000000100154641 _ZN5mongo12sayDbContextEPKc + 161
       1   mongod                              0x000000010062a92d _ZN5mongo8assertedEPKcS1_j + 269
       2   mongod                              0x0000000100259696 _ZN5mongo5ValueC2EPNS_11BSONElementE + 1862
       3   mongod                              0x0000000100259b22 _ZN5mongo5Value21createFromBsonElementEPNS_11BSONElementE + 50
       4   mongod                              0x000000010019e356 _ZN5mongo8DocumentC2EPNS_7BSONObjE + 278
       5   mongod                              0x000000010019e972 _ZN5mongo8Document17createFromBsonObjEPNS_7BSONObjE + 50
       6   mongod                              0x00000001006440d8 _ZN5mongo20DocumentSourceCursor8findNextEv + 488
       7   mongod                              0x00000001006442e5 _ZN5mongo20DocumentSourceCursor3eofEv + 53
       8   mongod                              0x000000010024e55d _ZN5mongo21DocumentSourceProject3eofEv + 29
       9   mongod                              0x000000010014ba9c _ZN5mongo8Pipeline3runERNS_14BSONObjBuilderERSsRKN5boost13intrusive_ptrINS_14DocumentSourceEEE + 604
       10  mongod                              0x00000001003d0a99 _ZN5mongo15PipelineCommand3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 153
       11  mongod                              0x000000010030a804 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb + 148
       12  mongod                              0x000000010030d0f4 _ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2148
       13  mongod                              0x000000010030fa27 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 2359
       14  mongod                              0x00000001001fb544 _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 52
       15  mongod                              0x00000001001fd83f _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 3343
       16  mongod                              0x00000001001d619e _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 654
       17  mongod                              0x00000001001dfbc6 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 870
       18  mongod                              0x00000001000206a4 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 148
       19  mongod                              0x0000000100275c70 _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 768

      This error will happen if an illegal type is in any of the documents passed into aggregation. Should be documented and improve the error message.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: