[SERVER-11269] Assertion failure is stopping mongorestore Created: 18/Oct/13  Updated: 10/Dec/14  Resolved: 22/Oct/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: debugging with submitter
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pawe? Smoli?ski Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: crash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 64-bit.
Backuped @ Debian Squeeze
Trying to restore @ Slackware 14


Operating System: Linux
Participants:

 Description   

When I'm trying to restore DB backup, I'm getting assertion failure message. Backup has been made by mongobackup ver. 2.4.4 (in production env) and I've tried to restore both using 2.4.4 and 2.4.6. In all cases I'm getting following error messages, after which mongorestore stops working (flags: --journal --directoryperdb --dbpath):

MongoDB 2.4.4:
Fri Oct 18 10:21:15.841 [tools] Assertion failure amt == (size_t)( size - 4 ) src/mongo/tools/tool.cpp 508
0xdd7561 0xd99ebd 0xd8f56a 0x6e3606 0x6e2a5b 0x6e2a5b 0x6e6d6c 0xd8e278 0xd93475 0x6cbf77 0x7f1c41aaed85 0x6cbde9
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo15printStackTraceERSo+0x21) [0xdd7561]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo12verifyFailedEPKcS1_j+0xfd) [0xd99ebd]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo8BSONTool11processFileERKN5boost11filesystem34pathE+0x78a) [0xd8f56a]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0xf36) [0x6e3606]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0x38b) [0x6e2a5b]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0x38b) [0x6e2a5b]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore5doRunEv+0xc7c) [0x6e6d6c]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo8BSONTool3runEv+0x458) [0xd8e278]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo4Tool4mainEiPPc+0x13d5) [0xd93475]
/home/pawel/bin/mongo/bin/mongorestore(main+0x37) [0x6cbf77]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f1c41aaed85]
/home/pawel/bin/mongo/bin/mongorestore(__gxx_personality_v0+0x459) [0x6cbde9]
assertion: 0 assertion src/mongo/tools/tool.cpp:508

MongoDB 2.4.6:
Fri Oct 18 11:16:18.912 [tools] Assertion failure amt == (size_t)( size - 4 ) src/mongo/tools/tool.cpp 508
0xde30f1 0xda58ed 0xd9d71a 0x6e4816 0x6e3c6b 0x6e3c6b 0x6e7f7c 0xd99cc8 0xd9fa5e 0x6cd187 0x7f7a00fe6d85 0x6ccff9
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo15printStackTraceERSo+0x21) [0xde30f1]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo12verifyFailedEPKcS1_j+0xfd) [0xda58ed]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo8BSONTool11processFileERKN5boost11filesystem34pathE+0x78a) [0xd9d71a]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0xf36) [0x6e4816]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0x38b) [0x6e3c6b]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore9drillDownEN5boost11filesystem34pathEbbbb+0x38b) [0x6e3c6b]
/home/pawel/bin/mongo/bin/mongorestore(_ZN7Restore5doRunEv+0xc7c) [0x6e7f7c]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo8BSONTool3runEv+0x458) [0xd99cc8]
/home/pawel/bin/mongo/bin/mongorestore(_ZN5mongo4Tool4mainEiPPc+0x13de) [0xd9fa5e]
/home/pawel/bin/mongo/bin/mongorestore(main+0x37) [0x6cd187]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f7a00fe6d85]
/home/pawel/bin/mongo/bin/mongorestore(__gxx_personality_v0+0x461) [0x6ccff9]
assertion: 0 assertion src/mongo/tools/tool.cpp:508



 Comments   
Comment by Rajesh Mandot [ 14/Nov/14 ]

I am getting the same error while restoring the dump with noobjcheck option for one of the collection. What was the resolution? Is the backup file corrupted? Can this file be checked somehow - if its corrupted?

Comment by Daniel Pasette (Inactive) [ 22/Oct/13 ]

Looks as if your backups are corrupted. If you find that is not the case, please re-open this issue.

Comment by Shaun Verch [ 21/Oct/13 ]

Hi Pawel,

The assertion means that mongorestore found a document with a bad size field. If you provide the following information it will help us diagnose the issue:

1. Do you see this assertion when you try to restore any backup, or just one?
2. Can you restore specific collections? Which collections can/can't you restore?
3. What is the exact command line you used to run mongorestore and mongodump?

Thanks,
~Shaun Verch

Comment by Pawe? Smoli?ski [ 19/Oct/13 ]

OK, I've found that it may be related to not-working mongobackup, as backup files are sth about 20-30% smaller than they should:
rw-rr- 1 root root 715345920 Oct 13 03:48 2013-10-13_03h30m.Sunday.tgz
rw-rr- 1 root root 714846208 Oct 14 03:49 2013-10-14_03h30m.Monday.tgz
rw-rr- 1 root root 639401984 Oct 15 03:49 2013-10-15_03h30m.Tuesday.tgz
rw-rr- 1 root root 661098496 Oct 16 03:51 2013-10-16_03h30m.Wednesday.tgz
rw-rr- 1 root root 639504384 Oct 17 03:48 2013-10-17_03h30m.Thursday.tgz
rw-rr- 1 root root 633143296 Oct 18 03:49 2013-10-18_03h30m.Friday.tgz

Generated at Thu Feb 08 03:25:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.