Mongodb restore problems

mongodb

Solution

Did you try `sudo chown -Rh mongodb:mongodb /var/lib/mongod*`?

This has all the hallmarks of a Linux permissions problem, chmod'ding 777 is always a bad idea.

Problem

Mongodb, running on an Ubuntu 12.04 box, decided to dump core because it opened too many files (applause). After running `mongod --repair` as root as http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/ alluded to (but didn't specify), I now find that mongo has apparently whacked out its own file permissions somehow - every time I try to start I get ``` Mon Apr 1 15:10:08 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log", nojournal: "true" } Mon Apr 1 15:10:09 [initandlisten] couldn't open /var/lib/mongod/cerebro_test_import_ayp_part2.ns errno:1 Operation not permitted Mon Apr 1 15:10:09 [initandlisten] error couldn't open file /var/lib/mongodb/cerebro_test_import_ayp_part2.ns terminating ``` "Operation not permitted"? Really? Even after ``` $ sudo chmod -R 777 /var/lib/mongodb ``` ? I'm a couple of millimeters away from just blowing this whole database away and chalking it up as yet another reason Mongo sucks. What can I do to get mongo happy again so I don't have to do that? What haven't I tried? What gives?

Original source