Core Server
  1. Core Server
  2. SERVER-994

Geospatial Bounding box query giving point not in range error

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.5.0
    • Fix Version/s: 1.5.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      linux x86-64
    • Backport:
      No
    • # Replies:
      8
    • Last comment by Customer:
      false

      Description

      I ran across the case where the bounding box query would sometimes give me a "point not in range" error with no discernible reason that I can find. You can recreate the issue with the following:

      db.foo.insert({ point :

      { x : -15000000, y : 10000000 }

      })
      db.foo.ensureIndex(

      { point : "2d" }

      ,

      { min : -21000000 , max : 21000000 }

      )
      db.foo.find({point: {"$within":

      {"$box": [[-20000000, 7000000], [0, 15000000]]}

      } })

      The console shows:
      error:

      { "$err" : "point not in range" }

      The mongod log shows:
      Sun Apr 11 00:50:35 User Exception 13027:point not in range
      Sun Apr 11 00:50:35 Assertion: 10362:point not in range
      0x505bb4 0x56219c 0x5fa2da 0x5feb2f 0x6a9a72 0x6bbde0 0x7f372ecb03ba 0x7f372e272fcd
      bin/mongod(_ZN5mongo11msgassertedEiPKc+0x204) [0x505bb4]
      bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpE+0x182c) [0x56219c]
      bin/mongod [0x5fa2da]
      bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERK11sockaddr_in+0x118f) [0x5feb2f]
      bin/mongod(_ZN5mongo10connThreadEv+0x242) [0x6a9a72]
      bin/mongod(thread_proxy+0x80) [0x6bbde0]
      /lib/libpthread.so.0 [0x7f372ecb03ba]
      /lib/libc.so.6(clone+0x6d) [0x7f372e272fcd]
      Sun Apr 11 00:50:35 Caught Assertion in runQuery ns:test.foo massert:point not in range
      Sun Apr 11 00:50:35 ntoskip:0 ntoreturn:0
      Sun Apr 11 00:50:35 query:{ point: { $within: { $box: { 0:

      { 0: -20000000.0, 1: 7000000.0 }

      , 1:

      { 0: 0.0, 1: 15000000.0 }

      } } } }
      Sun Apr 11 00:50:35 query test.foo ntoreturn:0 exception 1ms

      However running the query with a different bounding box like so:
      db.foo.find({point: {"$within":

      {"$box": [[-20000000, 0], [0, 15000000]]}

      } })
      WIll find the point as expected.

      I've run into quite a few of these that act the same way with various bounding boxes and data, any help will be greatly appreciated!

        Activity

        Hide
        auto
        added a comment -

        Author:

        {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

        Message: Squashed commit of the following:

        commit b639096a76de87adaf0e62e28e29b1155ba944a9
        Author: Richard Kreuter <richard@10gen.com>
        Date: Tue May 11 13:53:26 2010 -0400

        Replace sizeDiag calls w/sizeEdge; add a test. SERVER-994

        commit 75b0a08c96bfd6e1a7e7a6d002dd2391d0433575
        Author: Richard Kreuter <richard@10gen.com>
        Date: Fri May 7 16:29:48 2010 -0400

        Rename mongo::Geo2dType::size() to ::sizeDiag(); add a sizeEdge(). SERVER-994
        http://github.com/mongodb/mongo/commit/6845ac00e7fd391157b2c4efb14371d26de5f105

        Show
        auto
        added a comment - Author: {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'} Message: Squashed commit of the following: commit b639096a76de87adaf0e62e28e29b1155ba944a9 Author: Richard Kreuter <richard@10gen.com> Date: Tue May 11 13:53:26 2010 -0400 Replace sizeDiag calls w/sizeEdge; add a test. SERVER-994 commit 75b0a08c96bfd6e1a7e7a6d002dd2391d0433575 Author: Richard Kreuter <richard@10gen.com> Date: Fri May 7 16:29:48 2010 -0400 Rename mongo::Geo2dType::size() to ::sizeDiag(); add a sizeEdge(). SERVER-994 http://github.com/mongodb/mongo/commit/6845ac00e7fd391157b2c4efb14371d26de5f105
        Hide
        auto
        added a comment -

        Author:

        {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

        Message: Squashed commit of the following:

        commit b639096a76de87adaf0e62e28e29b1155ba944a9
        Author: Richard Kreuter <richard@10gen.com>
        Date: Tue May 11 13:53:26 2010 -0400

        Replace sizeDiag calls w/sizeEdge; add a test. SERVER-994

        commit 75b0a08c96bfd6e1a7e7a6d002dd2391d0433575
        Author: Richard Kreuter <richard@10gen.com>
        Date: Fri May 7 16:29:48 2010 -0400

        Rename mongo::Geo2dType::size() to ::sizeDiag(); add a sizeEdge(). SERVER-994
        http://github.com/mongodb/mongo/commit/6845ac00e7fd391157b2c4efb14371d26de5f105

        Show
        auto
        added a comment - Author: {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'} Message: Squashed commit of the following: commit b639096a76de87adaf0e62e28e29b1155ba944a9 Author: Richard Kreuter <richard@10gen.com> Date: Tue May 11 13:53:26 2010 -0400 Replace sizeDiag calls w/sizeEdge; add a test. SERVER-994 commit 75b0a08c96bfd6e1a7e7a6d002dd2391d0433575 Author: Richard Kreuter <richard@10gen.com> Date: Fri May 7 16:29:48 2010 -0400 Rename mongo::Geo2dType::size() to ::sizeDiag(); add a sizeEdge(). SERVER-994 http://github.com/mongodb/mongo/commit/6845ac00e7fd391157b2c4efb14371d26de5f105
        Hide
        auto
        added a comment -

        Author:

        {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

        Message: Fix test file for SERVER-994.
        http://github.com/mongodb/mongo/commit/bf780fbbfff29af8030aa56ca19f41d20995f08c

        Show
        auto
        added a comment - Author: {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'} Message: Fix test file for SERVER-994 . http://github.com/mongodb/mongo/commit/bf780fbbfff29af8030aa56ca19f41d20995f08c
        Hide
        auto
        added a comment -

        Author:

        {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

        Message: Characterize and add tests for the flaw in SERVER-994
        http://github.com/mongodb/mongo/commit/b0fa349d2eb222af8bd4aee8222128264e79b074

        Show
        auto
        added a comment - Author: {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'} Message: Characterize and add tests for the flaw in SERVER-994 http://github.com/mongodb/mongo/commit/b0fa349d2eb222af8bd4aee8222128264e79b074
        Hide
        Richard Kreuter
        added a comment -

        I think the bug here is fixed.

        Show
        Richard Kreuter
        added a comment - I think the bug here is fixed.
        Hide
        auto
        added a comment -

        Author:

        {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

        Message: Use FP error term in a geo bounds check. SERVER-994 strikes back (on x86).
        http://github.com/mongodb/mongo/commit/0b89d09b4fb90004c7851f44239bb33efdf32737

        Show
        auto
        added a comment - Author: {'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'} Message: Use FP error term in a geo bounds check. SERVER-994 strikes back (on x86). http://github.com/mongodb/mongo/commit/0b89d09b4fb90004c7851f44239bb33efdf32737
        Hide
        Ken Pratt
        added a comment - - edited

        This is marked as closed. However, I have another instance where "point not in range occurs" erroneously.

        The geo index is set with a max of 181 and a min of -181 in my collection.

        The following query produces the error:

        { "Placemark.Point.coordinates" : { "$within" :

        { "$box" : [ [ 172.3265993445506 , 9.18637494622202] , [ 180.0 , 20.3450110477435]]}

        }}

        Both of these points are in range.

        I'm using MongoDB version 1.6.3 running on Ubuntu 11.04 64 bit using latest Java driver.

        Show
        Ken Pratt
        added a comment - - edited This is marked as closed. However, I have another instance where "point not in range occurs" erroneously. The geo index is set with a max of 181 and a min of -181 in my collection. The following query produces the error: { "Placemark.Point.coordinates" : { "$within" : { "$box" : [ [ 172.3265993445506 , 9.18637494622202] , [ 180.0 , 20.3450110477435]]} }} Both of these points are in range. I'm using MongoDB version 1.6.3 running on Ubuntu 11.04 64 bit using latest Java driver.
        Hide
        Eliot Horowitz
        added a comment -

        @ken - can you try 1.8.2 and if still occurring there open a new ticket

        Show
        Eliot Horowitz
        added a comment - @ken - can you try 1.8.2 and if still occurring there open a new ticket

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              2 years, 43 weeks, 2 days ago
              Date of 1st Reply: