Yes, i recently ran into this too, restoring some data that had been dumped from a 2.2 machine as part of an upgrade.
It should not crash, that is a bug, but it should have also an option to either drop the record or truncate the key. Otherwise you end up with unrestorable backups and that is a no no.
If mongorestore had an option to create a json file of the data it could not insert becuase of either uniqueness or key length constraints, then there would be at least a way of fixing the data and recovering it using mongoimport.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/f89e0f1e-89c4-4301-a952-76bccd962cf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Asya,
We tried to set failIndexKeyTooLong before restoring the dump. But still it fails.
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/yzT5oC8lSFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJAjTa6rL1nJfFJn1FBBAigP%2BDqKGpxSLpq8WgEnf_s6iQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CA%2BMEUNt_d%2BrfkScgWfFx2%3DMQVRQ3cFs8nhz2mmt7Bp1FnYBONQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You set it to false and it still failed with error about key being too long?
Can you please include the exact error you got?
Hi Asya,
We tried to set failIndexKeyTooLong before restoring the dump. But still it fails.
On 16 Mar 2015 22:30, "Asya Kamsky" <as...@mongodb.com> wrote:
Right, this change is discussed here:
http://docs.mongodb.org/manual/reference/limits/#Index-Key-Limit
And there is an option in 2.6 to emulate the old behavior:
failIndexKeyTooLong which is discussed at the end of this page:
http://docs.mongodb.org/manual/release-notes/2.6-compatibility/#enforce-index-key-length-limit
Asya
On Mon, Mar 16, 2015 at 12:33 PM, Tim Hawkins <tim.th...@gmail.com> wrote:
> Yes, i recently ran into this too, restoring some data that had been dumped
> from a 2.2 machine as part of an upgrade.
>
> It should not crash, that is a bug, but it should have also an option to
> either drop the record or truncate the key. Otherwise you end up with
> unrestorable backups and that is a no no.
>
> If mongorestore had an option to create a json file of the data it could not
> insert becuase of either uniqueness or key length constraints, then there
> would be at least a way of fixing the data and recovering it using
> mongoimport.
>
>
>
>>
>>
>> It turns out that mongodb fails to index those documents where size of
>> index key is larger than 1024 b.
>>
>> 1 .We modified mongo/db/structure/btree/btree.h (Line294) 2014 to
>> 1048576 and compiled src.
>>
>> 2.Now while restoring data which was actually dumped from instace running
>> with mongodb 2.4.9. It fails to restore few indexes into mongodb.
>>
>> 3.Error: Error creating index mydatabase.mycollections: 1 err: "assertion
>> src/mongo/db/structure/btree/btree.cpp:579"
>> Aborted (core dumped).
>>
>> 4. We tried to set db.getSiblingDB('admin').runCommand( { setParameter:
>> 1, failIndexKeyTooLong: false } before mongorestore. But still mongorestore
>> failed to create those indexes.
>>
>> The KeyMax related discussion was also found here.
>>
>>
>> https://groups.google.com/forum/#!searchin/mongodb-user/index$20key$20too$20large/mongodb-user/Baz2XDH6T3c/fS56XOmHouoJ
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "mongodb-user"
>> group.
>>
>> For other MongoDB technical support options, see:
>> http://www.mongodb.org/about/support/.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "mongodb-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mongodb-user+unsubscribe@googlegroups.com.
>> To post to this group, send email to mongod...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/mongodb-user.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mongodb-user/f89e0f1e-89c4-4301-a952-76bccd962cf2%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user+unsubscribe@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/CAEbsasTvAOtmSrMYpeWO1HZu976K0U7_%3D8nKGK%3DsjCg87BJjFg%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
MongoDB World is back! June 1-2 in NYC. Use code ASYA for 25% off!
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/yzT5oC8lSFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJAjTa6rL1nJfFJn1FBBAigP%2BDqKGpxSLpq8WgEnf_s6iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CA%2BMEUNt_d%2BrfkScgWfFx2%3DMQVRQ3cFs8nhz2mmt7Bp1FnYBONQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No.
From documentation:
"Issue the following command to disable the index key length validation: for a running:program:mongod instance:
db.getSiblingDB('admin').runCommand( { setParameter: 1, failIndexKeyTooLong: false})
I am just doing it from mongo shell before restoring dump. It says I can either do it from mongo shell or
" mongod --setParameter failIndexKeyTooLong=false".
Done it from shell instead.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJDDAQgRkf_BJVUDVCPXZTD9RJ_TY%2Bdm3VZ9RoJLEs6VRw%40mail.gmail.com.
Hi Asya,
We downloaded source code from https://fastdl.mongodb.org/src/mongodb-src-r2.6.8.tar.gz?_ga=1.62651116.1797456972.1415870465.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/054421e4-4980-4411-a16b-a37f1dc056e7%40googlegroups.com.
We tried that earlier by using mongod that comes with packaged version 2.6.7 and that works well under these circumstances. No problem occurred.
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/yzT5oC8lSFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJCkCbUJ1X6hG9MyECTBw3OyM5rrHAvg3qcnuBsoKTTOHg%40mail.gmail.com.