[SERVER-994] Geospatial Bounding box query giving point not in range error Created: 11/Apr/10  Updated: 12/Jul/16  Resolved: 11/May/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.4.0, 1.5.0
Fix Version/s: 1.5.2

Type: Bug Priority: Major - P3
Reporter: Gavin R. Assignee: Richard Kreuter (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux x86-64


Participants:

 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!



 Comments   
Comment by Eliot Horowitz (Inactive) [ 20/Jun/11 ]

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

Comment by Ken Pratt [ 20/Jun/11 ]

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.

Comment by auto [ 15/Jul/10 ]

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

Comment by Richard Kreuter (Inactive) [ 11/May/10 ]

I think the bug here is fixed.

Comment by auto [ 11/May/10 ]

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

Comment by auto [ 11/May/10 ]

Author:

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

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

Comment by auto [ 11/May/10 ]

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

Comment by auto [ 11/May/10 ]

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

Generated at Thu Feb 08 02:55:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.