Exception thrown creating geo location index

49 views
Skip to first unread message

Gabriel

unread,
Oct 7, 2010, 5:05:17 PM10/7/10
to mongodb-user
Hi there,

Have a collection of objects with a geo-location field, instances look
like:
{
"_id" : ObjectId("4cae1384dab0905826d0d9ba"),
"name" : "Company name",
"location" : {
"latitude" : 42.43339920043945,
"longitude" : -71.44960021972656
}
}

I tried to create a geo location index using command (in mongo):
db.companies.ensureIndex({location : "2d"})
It fails (message in mongo is: "in > 0" )

In the logs I found this:
Thu Oct 7 16:57:57 [conn2] building new index on { location: "2d" }
for search.companies
Thu Oct 7 16:57:57 [conn2] search.system.indexes Assertion failure
in > 0 db/geo/2d.cpp 199
0x534771 0x54134f 0x77ccc4 0x77f039 0x78f60f 0x5c9050 0x72376a
0x724ca3 0x726a05 0x72d4af 0x7047aa 0x708bd9 0x8235ef 0x837460
0x3998606617 0x3997ed3c2d
./mongod(_ZN5mongo12sayDbContextEPKc+0xb1) [0x534771]
./mongod(_ZN5mongo8assertedEPKcS1_j+0x10f) [0x54134f]
./mongod(_ZNK5mongo9Geo2dType4hashEdd+0x1d4) [0x77ccc4]
./mongod(_ZNK5mongo9Geo2dType5_hashERKNS_7BSONObjE+0x1c9) [0x77f039]
./
mongod(_ZNK5mongo9Geo2dType7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE
+0x41f) [0x78f60f]
./
mongod(_ZNK5mongo9IndexSpec7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE
+0x40) [0x5c9050]
./
mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEi
+0x68a) [0x72376a]
./mongod [0x724ca3]
./mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibRKNS_11BSONElementEb
+0xa15) [0x726a05]
./mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb
+0x5f) [0x72d4af]
./mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x28a)
[0x7047aa]
./
mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE
+0x15f9) [0x708bd9]
./mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x30f) [0x8235ef]
./mongod(thread_proxy+0x80) [0x837460]
/lib64/libpthread.so.0 [0x3998606617]
/lib64/libc.so.6(clone+0x6d) [0x3997ed3c2d]
Thu Oct 7 16:57:57 [conn2] insert search.system.indexes exception 0
assertion db/geo/2d.cpp:199 202ms

Any help is appreciated.

Thanks,
Gabriel

Kristina Chodorow

unread,
Oct 7, 2010, 5:20:52 PM10/7/10
to mongod...@googlegroups.com
Is it possible you have points outside (or on the border) of the default -180 to 180 range?



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Gabriel

unread,
Oct 8, 2010, 2:09:04 PM10/8/10
to mongodb-user
I had a few of those and when I tried to create the index it would say
explictly that one or more points are outside the range.
So I doubt this is it - it definitely did noy crash when values where
out of bounds...
I should also mention that there are 50+ millions of these objects, in
case that helps.
> > mongod(_ZNK5mongo9Geo2dType7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCm­pDefaultOrderESaIS1_EE
> > +0x41f) [0x78f60f]
> >  ./
>
> > mongod(_ZNK5mongo9IndexSpec7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCm­pDefaultOrderESaIS1_EE
> > +0x40) [0x5c9050]
> >  ./
>
> > mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetai­lsEi
> > +0x68a) [0x72376a]
> >  ./mongod [0x724ca3]
> >  ./mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibRKNS_11BSONElementEb
> > +0xa15) [0x726a05]
> >  ./mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb
> > +0x5f) [0x72d4af]
> >  ./mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x28a)
> > [0x7047aa]
> >  ./
>
> > mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8Sock­AddrE
> > +0x15f9) [0x708bd9]
> >  ./mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x30f) [0x8235ef]
> >  ./mongod(thread_proxy+0x80) [0x837460]
> >  /lib64/libpthread.so.0 [0x3998606617]
> >  /lib64/libc.so.6(clone+0x6d) [0x3997ed3c2d]
> > Thu Oct  7 16:57:57 [conn2] insert search.system.indexes exception 0
> > assertion db/geo/2d.cpp:199 202ms
>
> > Any help is appreciated.
>
> > Thanks,
> > Gabriel
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mongodb-user" group.
> > To post to this group, send email to mongod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google­groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/mongodb-user?hl=en.- Hide quoted text -
>
> - Show quoted text -

Kristina Chodorow

unread,
Oct 8, 2010, 4:12:49 PM10/8/10
to mongod...@googlegroups.com
It's triggered when you have something right on the border:

> db.foo.insert({location:[1,-180]})
> db.foo.ensureIndex({location:"2d"})

Fri Oct  8 16:12:07 [conn1]  test.system.indexes Assertion failure in > 0 db/geo/2d.cpp 211



To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages