Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exception: BSONObj size: -286331154 (0xEEEEEEEE) is invalid. Size must be between 0 and 16793600(16MB)

Tags:

mongodb

I'm trying to use the full search http://docs.mongodb.org/manual/tutorial/search-for-text/

db ['Item']. runCommand ('text', {search: 'deep voice', language: 'english'})

it works well

but when I add conditions

db['Item'].runCommand( 'text', { search: 'deep voice' , language: 'english' , filter: {"and":[{"_extendedBy":{"in":["Voiceover"]}},{"and":[{"or":[{"removed":null},{"removed":{"\(exists":false}}]},{"category":ObjectId("51bc464ab012269e23278d55")},{"active":true},{"visible":true}]}]} } )

I receive an error

{

    "queryDebugString" : "deep|voic||||||",

    "language" : "english",

    "errmsg" : "exception: BSONObj size: -286331154 (0xEEEEEEEE) is invalid. Size must be between 0 and 16793600(16MB) First element: _extendedBy: \"Voiceover\"",
    "code" : 10334,

    "ok" : 0

}

delete the word "voice"

db['Item'].runCommand( 'text', { search: 'deep' , language: 'english' , filter: {"\)and":[{"_extendedBy":{"in":["Voiceover"]}},{"and":[{"or":[{"removed":null},{"removed":{"exists":false}}]},{"category":ObjectId("51bc464ab012269e23278d55")},{"active":true},{"visible":true}]}]} } );

receive

response to a request ...... ......

],

"stats" : {

    "nscanned" : 87,

    "nscannedObjects" : 87,

    "n" : 18,

    "nfound" : 18,

    "timeMicros" : 1013

},

"ok" : 1

}

Couldn’t understand why the error occurs?

database is not large "storageSize" : 2793472,

> db.Item.stats()

{

    "ns" : "internetjock.Item",

    "count" : 616,

    "size" : 2035840,

    "avgObjSize" : 3304.935064935065,

    "storageSize" : 2793472,

    "numExtents" : 5,

    "nindexes" : 12,

    "lastExtentSize" : 2097152,

    "paddingFactor" : 1.0000000000001221,

    "systemFlags" : 0,

    "userFlags" : 1,

    "totalIndexSize" : 7440160,

    "indexSizes" : {

            "_id_" : 24528,

            "modlrHff22a60ae822e1e68ba919bbedcb8957d5c5d10f" : 40880,

            "modlrH6f786b134a46c37db715aa2c831cfbe1fadb9d1d" : 40880,

            "modlrI467f6180af484be29ee9258920fc4837992c825e" : 24528,

            "modlrI5cb302f507b9d0409921ac0c51f7d9fc4fd5d2ee" : 40880,

            "modlrI6393f31b5b6b4b2cd9517391dabf5db6d6dd3c28" : 8176,

            "modlrI1c5cbf0ce48258a5a39c1ac54a1c1a038ebe1027" : 32704,

            "modlrH6e623929cc3867746630bae4572b9dbe5bd3b9f7" : 40880,

            "modlrH72ea9b8456321008fd832ef9459d868800ce87cb" : 40880,

            "modlrU821e16c04f9069f8d0b705d78d8f666a007c274d" : 24528,

            "modlrT88fc09e54b17679b0028556344b50c9fe169bdb5" : 7080416,

            "modlrIefa804b72cc346d66957110e286839a3f42793ef" : 40880

    },

    "ok" : 1

}
like image 929
user3386247 Avatar asked Jan 26 '26 17:01

user3386247


2 Answers

I had same problem with mongo 3.0.0 and 3.1.9 with relatively small database (12GB).

After wasting roughly 4 hours of time on this I found workaround using hidden parameter

mongorestore --batchSize=10

where number varies depending on nature of your data. Start with 1000.

like image 91
expert Avatar answered Jan 29 '26 06:01

expert


The result document returned by the first query is apparently greater than 16MB. MongoDB has a max document size of 16MB. The second query is returning a document that's lesser than 16MB and hence no errors.

There's no way around this. Here's the link to documentation:

http://docs.mongodb.org/manual/reference/limits/

like image 27
Anand Jayabalan Avatar answered Jan 29 '26 06:01

Anand Jayabalan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!