2

I've rebooted my Mac countless times before and never encountered this issue. Today, I rebooted my mac, started up Mongo with the mongod command, connected to my localhost instance with Mongochef and there is nothing in there..

I can see in the logs it shows:

2016-11-22T16:54:44.425+0000 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.

I've ran mongod --repair which shows lines such as:

2016-11-23T08:52:59.016+0000 I INDEX [initandlisten] build index on: affiliatecheckr.user properties: { v: 1, unique: true, key: { email: 1 }, name: "email_1", ns: "affiliatecheckr.user", sparse: true } 2016-11-23T08:52:59.386+0000 I INDEX [initandlisten] build index on: food.item_restaurants__restaurant_items properties: { v: 1, key: { _id: 1 }, name: "id", ns: "food.item_restaurants__restaurant_items" }

These are related to all the databases I had in Mongo, so where have they gone? Can anyone help restore this data?

K20GH
  • 6,032
  • 20
  • 78
  • 118

1 Answers1

3

The repair databases command re-writes the data files used to store data. The index build log messages you observed were likely the repair process rebuilding the indexes on each collection during this process.

The initial error message indicated that an unclean shutdown took place. This is discussed here.

Community
  • 1
  • 1
Adam Harrison
  • 3,323
  • 2
  • 17
  • 25