When I am saving documents in monogdb, getting the following error:
WriteConcern detected an error 'insertDocument :: caused by ::
0 assertion src\mongo\db\structure\btree\btree.cpp:390'.
(Response was {
"ok" : 1, "code" : 8, "err" : "insertDocument :: caused by :: 0
assertion src\\mongo\\db\\structure\\btree\\btree.cpp:390", "n" : NumberLong(0)
})
Any help please?
It seems like the code is failing during verify() assertion call while adding a key into a bucket. This error should come with extra details in the log file such as:
btree bucket corrupt? consider reindexing or running validate command klast: X key: Y
which suggets that your btree bucket could be corrupted.
So consider repairing your database by:
mongod --repair --dbpath /path/to/data/db
then reindex if necessary.
Also make sure you've enough free space on your device and got the right read and write permissions. If this happens often, either it's a bug or fault of your storage device.