Mongo restore Error

714 views
Skip to first unread message

Asoka Sampath Edussooriya

unread,
Dec 1, 2011, 10:30:06 AM12/1/11
to mongod...@googlegroups.com
Hi,

I got the following error when I was trying to restore the dump to the db

assertion: 10264 invalid object size: 1096040772

my mongo db.version() says  2.0.1 

any help ?

Thanks!

Asoka

--
Asoka Sampath Edussooriya

Barrie

unread,
Dec 1, 2011, 2:38:13 PM12/1/11
to mongodb-user
Hey Asoka,

Has your database ever crashed before?  Maybe you can run a repair
first before restoring again.

Can you paste the log, and if you have it, the dump file that failed?

On Dec 1, 10:30 am, Asoka Sampath Edussooriya <eas...@gmail.com>
wrote:

Asoka Sampath Edussooriya

unread,
Dec 2, 2011, 1:04:37 AM12/2/11
to mongod...@googlegroups.com
Hey Barrie,

this is the message it shows when i try mongorestore 

connected to: 127.0.0.1
Fri Dec  2 11:31:29 /home/asoka/mongo_mydb.bson
Fri Dec  2 11:31:29 going into namespace [mydb.student]
assertion: 10264 invalid object size: 1096040772

and the log it says 

Fri Dec  2 11:33:04 [initandlisten] connection accepted from 127.0.0.1:41249 #8
Fri Dec  2 11:33:04 [conn8] end connection 127.0.0.1:41249

I have repaired the db before restoring 

Thanks!

Asoka


--
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.




--
Asoka Sampath Edussooriya

Nat

unread,
Dec 2, 2011, 2:31:37 AM12/2/11
to mongod...@googlegroups.com
Did you repair the database before backing up? it couldd be that your database corrupted before you took the backup of it.
From: Asoka Sampath Edussooriya <eas...@gmail.com>
Date: Fri, 2 Dec 2011 11:34:37 +0530
Subject: Re: [mongodb-user] Re: Mongo restore Error

Nik

unread,
Dec 6, 2011, 4:21:40 AM12/6/11
to mongod...@googlegroups.com
I'm also having the same issue. In my case its a fresh copy. I dumped the same db and tried to restore it but didn't work.

~# mongorestore --db test --collection cltn dump.bson
connected to: 127.0.0.1
Tue Dec  6 14:30:50 dump.bson
Tue Dec  6 14:30:50      going into namespace [test.cltn]

assertion: 10264 invalid object size: 1096040772

above is what i have done and what i got. I am a newbie for mongo. My mongo version is 2.0.1. can anyone help...?

Thanks,
Nik.


Eliot Horowitz

unread,
Dec 6, 2011, 4:28:13 AM12/6/11
to mongod...@googlegroups.com
How did you do the dump?

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.

> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/ij-5PWhGbcoJ.

Dinoosh Nikapitiya

unread,
Dec 6, 2011, 4:39:25 AM12/6/11
to mongod...@googlegroups.com
i used mongodump command as follows.
mongodump --db test --collection cltn > dump.bson

and got this
connected to: 127.0.0.1

Nik

unread,
Dec 6, 2011, 4:51:50 AM12/6/11
to mongod...@googlegroups.com
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? 

Brandon Diamond

unread,
Dec 6, 2011, 1:26:17 PM12/6/11
to mongodb-user
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.

Asoka Sampath Edussooriya

unread,
Dec 6, 2011, 9:23:58 PM12/6/11
to mongod...@googlegroups.com
Hi Brandon,

Still I get the same error. 

Thanks!

Asoka

--
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.




--
Asoka Sampath Edussooriya

Eliot Horowitz

unread,
Dec 6, 2011, 9:32:04 PM12/6/11
to mongod...@googlegroups.com
Can you just run mongodump -d ... -c ...
without piping and try that

Gianfranco

unread,
Oct 5, 2012, 8:25:52 AM10/5/12
to mongod...@googlegroups.com, el...@10gen.com
Thanks for that Balthazar.

At the moment is better to use the output directory option "--out dir-name" instead of stdout "--out -" and then write into a file.

There is Jira ticket for this issue:
https://jira.mongodb.org/browse/SERVER-7007

On Friday, September 28, 2012 11:58:04 AM UTC+1, Balthazar Rouberol wrote:
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
Reply all
Reply to author
Forward
0 new messages