I got the same error using a standalone mongoDB 2.2, and found a way to fix
it.
I used the mongodump command as following:
mongodump --db twitter_nlp --collection home_timeline --out ->
home_timeline.bson
mongorestore gave me the following output:
$ mongorestore --db twitter_nlp --collection test home_timeline.bson
connected to: 127.0.0.1
Fri Sep 28 12:53:47 home_timeline.bson
Fri Sep 28 12:53:47 going into namespace [twitter_nlp.test]
Fri Sep 28 12:53:47 home_timeline.metadata.json not found. Skipping.
*assertion: 10264 invalid object size: 543781446*
If you remove the first line of the bson file, with the following command,
the mongorestore operation will work.
$ tail -n+2 home_timeline.bson > home_timeline_fix.bson
$ mongorestore --db twitter_nlp --collection test home_timeline_fix.bson
connected to: 127.0.0.1
Fri Sep 28 12:55:10 home_timeline_fix.bson
Fri Sep 28 12:55:10 going into namespace [twitter_nlp.test]
Fri Sep 28 12:55:10 home_timeline_fix.metadata.json not found. Skipping.
2516 objects found
NB: the first line of home_timeline.bson contains "Fri Sep 28 12:51:14
doing snapshot query",
which does not seem to be relevant for mongorestore.
--
Balthazar
On Wednesday, December 7, 2011 3:32:04 AM UTC+1, Eliot Horowitz wrote:
> Can you just run mongodump -d ... -c ...
> without piping and try that
> On Tue, Dec 6, 2011 at 9:23 PM, Asoka Sampath Edussooriya
> <eas...@gmail.com <javascript:>> wrote:
> > Hi Brandon,
> > Still I get the same error.
> > Thanks!
> > Asoka
> > On Tue, Dec 6, 2011 at 11:56 PM, Brandon Diamond <bra...@10gen.com<javascript:>>
> wrote:
> >> I suspect that some of the non-bson output of mongodump may have been
> >> included in dump.bson
> >> Please try re-dumping using the "--out" option to set the output
> >> location.
> >> On Dec 6, 4:51 am, Nik <dinoosh.n...@gmail.com> wrote:
> >> > dump was successful. I dumped the db and again tried to restore to a
> >> > separate db. still the same error... this is a fresh installation of
> >> > mongodb. do i have change some configuration or create some?
> >> --
> >> 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<javascript:>
> .
> >> To unsubscribe from this group, send email to
> >> mongodb-user...@googlegroups.com <javascript:>.
> >> For more options, visit this group at
> >> http://groups.google.com/group/mongodb-user?hl=en.
> > --
> > Asoka Sampath Edussooriya
> > --
> > 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<javascript:>
> .
> > To unsubscribe from this group, send email to
> > mongodb-user...@googlegroups.com <javascript:>.
> > For more options, visit this group at
> > http://groups.google.com/group/mongodb-user?hl=en.