5

I changed dbpath of my mongodb, and moved content of earlier dbpath folder to the new one. But the server is not starting up. Upon investigating mongodb logs, I found following exception:

016-05-23T10:50:51.697+0000 I STORAGE [initandlisten] exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/media/user/Shared/mongodb/storage.bson", terminating

I found a similar question here, but it did not help me fix the issue. Here is the current permissions of my dbpath folder and storage.bson file:

-rwxrwxrwx 1 mongodb mongodb         69    May 23 08:57 storage.bson*
drwxrwxrwx 3 mongodb mongodb         4096  May 23 09:04 mongodb/

I did try removing lock file (/var/lib/mongodb/mongod.lock) but it also did not help me.

BTW, I am using version v3.0.8 of MongoDB and starting it through sudo service mongodb start

Community
  • 1
  • 1
Manish Kapoor
  • 488
  • 3
  • 16

1 Answers1

2

Had the same problem resolved by adding the executable permission to other users on the /home, and all the way down to the db path. for example:

chmod -R o+x /<home>

or more specific (notice the -R recursive flag) chmod o+x /<home> chmod -R o+x /<home>/mongodb

oori
  • 5,533
  • 1
  • 30
  • 37
  • Solved my problem but I had to make a slight modification to the second command so that it became: `chmod -R o+rwx //mongodb` – Archy Oct 06 '17 at 07:18
  • Had to follow the instructions in [this](https://stackoverflow.com/questions/41615574/mongodb-server-has-startup-warnings-access-control-is-not-enabled-for-the-dat) thread to get rid of the warning `WARNING: Access control is not enabled for the database.` – Archy Oct 06 '17 at 07:29