17

I am trying to start mongodb 4.0.4 on ubuntu 16.04, but the database denies all my tries. I checked mongodb log files and find out that the file named WiredTiger.turtle has no needed permissions. Here log errors:

2018-11-26T15:14:32.438+0600 E STORAGE  [initandlisten] WiredTiger error (13) [1543223672:438144][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied Raw: [1543223672:438144][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied
2018-11-26T15:14:32.438+0600 E STORAGE  [initandlisten] WiredTiger error (13) [1543223672:438429][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied Raw: [1543223672:438429][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied
2018-11-26T15:14:32.438+0600 E STORAGE  [initandlisten] WiredTiger error (13) [1543223672:438594][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied Raw: [1543223672:438594][32673:0x7fee423e3a40], wiredtiger_open: __posix_open_file, 715: /var/lib/mongodb/WiredTiger.turtle: handle-open: open: Permission denied
2018-11-26T15:14:32.438+0600 W STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
2018-11-26T15:14:32.438+0600 F STORAGE  [initandlisten] Reason: 13: Permission denied
2018-11-26T15:14:32.438+0600 F -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 646
2018-11-26T15:14:32.438+0600 F -        [initandlisten] 

***aborting after fassert() failure

I gave all permissions to the all files in /var/lib/mongodb/. But when I start mongodb WiredTiger.turtle file's permission reset. Just for check I deleted this file, but file appears itself again and error repeats.

user3151148
  • 375
  • 2
  • 3
  • 8

3 Answers3

37

Same problem with WiredTiger.turtle permissions. Ubuntu 18.04 My problem was I started a mongod service with sudo. This created files with root:root ownership in my database directory. When starting mongod service without sudo I received the permission denied error.

Solution was to change ownership of all files in the db directory back to mongodb:mongodb

$ sudo chown -R mongodb:mongodb /var/lib/mongodb/*

Anthony
  • 13,434
  • 14
  • 60
  • 80
FiaSoM
  • 471
  • 4
  • 3
0

I solve the same problem that you had deleting my /data/db folder, after that I re-created it and I gave it write and read control.

I used the official documentation to install my version but additional I did the stuff with data folder

Hope help.

Juanbg.dev
  • 21
  • 6
0

In my case on Manjaro-Linux (Arch-Linux like), there was a wrong user:group permission on /var/lib/mongodb/WiredTiger.turtle.

Doing sudo chown mongodb:daemon /var/lib/mongodb/WiredTiger.turtle fix it for me.

BUT what was the cause of this permission-failure?

The cause was, that I've tried to limit the Cache-Usage of the wiredTigerCache. Everytime I try this, permissions are set in wrong way to root:root sudo mongod --wiredTigerCacheSizeGB 1

suther
  • 12,600
  • 4
  • 62
  • 99