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

Invalid BSON docs lead to errors in complex queries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Duplicate
    • Affects Version/s: 2.4.5, 2.4.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      linux ubuntu 12.10
    • Operating System:
      Linux
    • Steps To Reproduce:
      Hide

      load this dump: http://privatepaste.com/download/576b7e1184

      run the index: db.users5.ensureIndex(

      { "_id": 1, "times.current_location": 1, "places.current.geolocation" : "2dsphere"}

      ,

      { "sparse": true }

      );

      run this command
      db.runCommand( { "geoNear": "users5", "near":

      { "type": "Point", "coordinates": [ 0,0 ] }

      , "spherical" : true } )

      Show
      load this dump: http://privatepaste.com/download/576b7e1184 run the index: db.users5.ensureIndex( { "_id": 1, "times.current_location": 1, "places.current.geolocation" : "2dsphere"} , { "sparse": true } ); run this command db.runCommand( { "geoNear": "users5", "near": { "type": "Point", "coordinates": [ 0,0 ] } , "spherical" : true } )

      Description

      I believe there are few documents stored in my db which are not BSON valid or cause issue when retured, since when they are included into the result set of $and $or $geonear queries they made it error. I have identified one record which is definitely causing this problem. The only thing I can see is when I print it on the shell it indents wrongly and misses some key, but when it is exported it is a valid JSON and the dump also looks a correct binary.

      db.runCommand( { "geoNear": 'users5', "near":

      { "type": "Point", "coordinates": [ 0, 0 ] }

      , "spherical": true, num: 1 } )
      {
      "ns" : "your_db.users5",
      "results" : [ ],
      "errmsg" : "exception: wrong type for field () 10 != 2",
      "code" : 13111,
      "ok" : 0
      }

      Further details on http://pastie.org/8308587

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stennie Stennie Steneker
              Reporter:
              fmoscon Fabrizio Moscon
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: