oluckyman
oluckyman

Reputation: 3896

mongorestore fails on empty system.js.bson

I’m trying to restore dumped db to the local server but it fails.

To make dump I run:
mongodump --host somehost.com -d app123 --port 10043 --username my_username --password my_password --out /tmp/mongodump
and it works fine.

To restore I run:
mongorestore --db my_db --drop /tmp/mongodump/app123
and it fails on empty file:

2015-01-05T12:56:47.759+0100 /tmp/mongodump/app123/system.js.bson
2015-01-05T12:56:47.759+0100    going into namespace [my_db.system.js]
file /tmp/mongodump/app123/system.js.bson empty, skipping
2015-01-05T12:56:47.759+0100    Creating index: { key: { _id: 1 }, ns: "my_db.system.js", name: "_id_" }
2015-01-05T12:56:47.803+0100 DBClientCursor::init call() failed
assertion: 10276 DBClientBase::findN: transport error: 127.0.0.1:27017 ns: my_db.$cmd query: { getlasterror: 1 }  

If I delete system.* from the dump then mongorestore works without any errors.

Upvotes: 0

Views: 397

Answers (1)

Owain Williams
Owain Williams

Reputation: 2647

I think this is to do with the _id_ index. Try deleting or renaming this, then doing another mongodump and see if that works.

I had a similar issue once and it was to do with an index. I can't remember if I deleted the index or renamed it. So it could be down to the underscores, in which case renaming it should work. Or maybe something's corrupted in the index, in which case deleting it is your only option.

Upvotes: 1

Related Questions