Having trouble installing and using mongodb. on my macosx and a readonly /data/db - mongodb

I want to install Mongodb for my next online web course but the thing is I'm having so much issues. I have been installing and uninstall mongodb so many times I think it's conflicting with temp ... Can someone guide me to the process please, really would appreciate it.
The error when running mongodb:
017-07-02T10:31:41.547-0400 I STORAGE [initandlisten] exception in
initAndListen: 20 Attempted to create a lock file on a read-only
directory: /data/db, terminating 2017-07-02T10:31:41.547-0400 I
NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-07-02T10:31:41.547-0400 I NETWORK [initandlisten] shutdown: going
to flush diaglog... 2017-07-02T10:31:41.547-0400 I CONTROL
[initandlisten] now exiting 2017-07-02T10:31:41.547-0400 I CONTROL
[initandlisten] shutting down with code:100 –
I tried installing it on homebrew , nothing happen, I tried installing it manually still having troubles.. I know my basic like cd,ls,rm,pwd,touch, when using the terminal, If theres process that i can wipe everything associate with mangodb in my Macbook and install it again i have no problem.
found out that /data/db is readonly

MongoDB is already installed but you have some issue launching it.
017-07-02T10:31:41.547-0400 I STORAGE [initandlisten] exception in
initAndListen: 20 Attempted to create a lock file on a read-only
directory: /data/db, terminating 2017-07-02T10:31:41.547-0400 I
NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-07-02T10:31:41.547-0400 I NETWORK [initandlisten] shutdown: going
to flush diaglog... 2017-07-02T10:31:41.547-0400 I CONTROL
[initandlisten] now exiting 2017-07-02T10:31:41.547-0400 I CONTROL
[initandlisten] shutting down with code:100 –
Change the permission of /data/db
sudo chown -R `id -un` /data/db
Now you should start the daemon without problem:mongod
then connect with your mongo client by typing. mongo
ok.. then got this. 2017-07-02T10:50:39.069-0400 I CONTROL
[initandlisten] options: { repair: true, storage: { dbPath: "/data/db"
} } 2017-07-02T10:50:39.069-0400 W - [initandlisten] Detected unclean
shutdown - /data/db/mongod.lock is not empty.
2017-07-02T10:50:39.069-0400 E NETWORK [initandlisten] Failed to
unlink socket file /tmp/mongodb-27017.sock Permission denied
2017-07-02T10:50:39.069-0400 I - [initandlisten] Fatal Assertion 28578
at src/mongo/util/net/listen.cpp 195 2017-07-02T10:50:39.070-0400 I -
[initandlisten] ***aborting after fassert() failure
your /tmp is maybe not readable, try:
chmod 1777 /tmp

Related

GoormIDE | Can't run mongod in GoormIDE Container

For context: I am creating a website in html+ejs+mongoose which I had created locally on my pc. Since I want to see the website running on another device besides my local computer, I uploaded the files on GitHub and then cloned it into an online IDE, in this case, GoormIDE, to do that.
As the title above had said, I can't run mongod in a container even though I have enabled mongoDB in the container setup. I created a file which is mongod which runs the code mongod --nojournal so that I will not have journal files in my directory. I kept receiving this error code:
2020-12-27T05:24:49.128+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] MongoDB starting : pid=802 port=27017 dbpath=/data/db 64-bit host=goorm
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] db version v4.0.22
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] git version: 1741806fb46c161a1d42870f6e98f5100d196315
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] modules: none
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] build environment:
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] distmod: ubuntu1804
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] distarch: x86_64
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] 1024 MB of memory available to the process out of 7771 MB total system memory
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] options: { storage: { journal: { enabled: false } } }
2020-12-27T05:24:49.135+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating
2020-12-27T05:24:49.136+0000 I REPL [initandlisten] Stepping down the ReplicationCoordinator for shutdown, waitTime: 10000ms
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] Shutting down the global connection pool
2020-12-27T05:24:49.136+0000 I - [initandlisten] Killing all operations for shutdown
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] Shutting down the ReplicaSetMonitor
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] Shutting down free monitoring
2020-12-27T05:24:49.136+0000 I FTDC [initandlisten] Shutting down full-time data capture
2020-12-27T05:24:49.136+0000 I STORAGE [initandlisten] Shutting down the HealthLog
2020-12-27T05:24:49.136+0000 I - [initandlisten] Dropping the scope cache for shutdown
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] now exiting
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] shutting down with code:100
Because of this, I can't start the website because it needs mongoDB/mongoose in order to run the server.
It seems that mongod/mongoDB doesn't have a data directory. Any ideas?
I already found the answer guys!
I just need to put -dbpath ./data/db after mongod
With that, I created a directory of data/db where I will store all the data from mongoDB.
so now I edited the file that I created named "mongod" with: mongod --nojournal -dbpath ./data/db and everything works once again. I feel pretty silly not knowing this but I hope I will never make this mistake again.

Connect failed to mongodb shell

I have installed mongo, run the shell success in couple of time, then I try to add:
security:
authorization: disabled
because I want to add user Admin to admin db. After that, I can not access the mongo shell, this error show up when run command mongo
MongoDB shell version v3.6.2
connecting to: mongodb://127.0.0.1:27017
2018-02-09T09:34:48.769+0700 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-02-09T09:34:48.769+0700 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
And here is few last lines of the log file after disable authorization, even when enable it again, thing doesn't work /var/log/mongodb/mongod.log
2018-02-09T09:33:00.843+0700 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-02-09T09:33:00.843+0700 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-02-09T09:33:00.843+0700 I CONTROL [initandlisten]
2018-02-09T09:33:00.847+0700 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
2018-02-09T09:33:00.847+0700 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2018-02-09T09:33:00.847+0700 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-02-09T09:33:00.847+0700 I REPL [initandlisten] shutdown: removing all drop-pending collections...
2018-02-09T09:33:00.847+0700 I REPL [initandlisten] shutdown: removing checkpointTimestamp collection...
2018-02-09T09:33:00.848+0700 I STORAGE [initandlisten] shutdown: waiting for fs preallocator...
2018-02-09T09:33:00.848+0700 I STORAGE [initandlisten] shutdown: final commit...
2018-02-09T09:33:00.849+0700 I JOURNAL [initandlisten] journalCleanup...
2018-02-09T09:33:00.849+0700 I JOURNAL [initandlisten] removeJournalFiles
2018-02-09T09:33:00.876+0700 I JOURNAL [initandlisten] old journal file /var/lib/mongodb/journal/j._0 will be reused as /var/lib/mongodb/journal/prealloc.0
2018-02-09T09:33:00.899+0700 I JOURNAL [initandlisten] Terminating durability thread ...
2018-02-09T09:33:00.950+0700 I JOURNAL [journal writer] Journal writer thread stopped
2018-02-09T09:33:00.950+0700 I JOURNAL [durability] Durability thread stopped
2018-02-09T09:33:00.950+0700 I STORAGE [initandlisten] shutdown: closing all files...
2018-02-09T09:33:00.953+0700 I STORAGE [initandlisten] closeAllFiles() finished
2018-02-09T09:33:00.953+0700 I STORAGE [initandlisten] shutdown: removing fs lock...
2018-02-09T09:33:00.953+0700 I CONTROL [initandlisten] now exiting
2018-02-09T09:33:00.953+0700 I CONTROL [initandlisten] shutting down with code:62
I tried to run sudo service mongod restart but doesn't work.
So can you give me some advices for this problem, thanks
Is seems that mongod can't start because your system has updated mongodb from version < 3.4 to 3.6 as it stated in the log: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6
You need to downgrade mongodb to 3.4, then sudo service mongod start to trigger the db migration to 3.4.
I just try to run this command and it works for me brew services start mongodb
Cheers.

Mongod error (installed with homebrew)

I have installed mongodb with
brew install mongodb
Created folder
mkdir -p /data/db
Handle permissions
sudo chown -R `id -un` /data/db
Run
mongod
Error log
2018-01-06T14:28:51.450+0100 I CONTROL [initandlisten] MongoDB starting : pid=6120 port=27017 dbpath=/data/db 64-bit host=Zigas-MBP-2
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] db version v3.6.1
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] git version: 025d4f4fe61efd1fb6f0005be20cb45a004093d1
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] allocator: system
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] modules: none
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] build environment:
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] distarch: x86_64
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] target_arch: x86_64
2018-01-06T14:28:51.451+0100 I CONTROL [initandlisten] options: {}
2018-01-06T14:28:51.452+0100 I - [initandlisten] Detected data files in /data/db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2018-01-06T14:28:51.470+0100 I JOURNAL [initandlisten] journal dir=/data/db/journal
2018-01-06T14:28:51.471+0100 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2018-01-06T14:28:51.494+0100 I JOURNAL [durability] Durability thread started
2018-01-06T14:28:51.494+0100 I JOURNAL [journal writer] Journal writer thread started
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten]
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten]
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** Remote systems will be unable toconnect to this server.
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-01-06T14:28:51.495+0100 I CONTROL [initandlisten]
2018-01-06T14:28:51.762+0100 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
2018-01-06T14:28:51.762+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2018-01-06T14:28:51.763+0100 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-01-06T14:28:51.763+0100 I REPL [initandlisten] shutdown: removing all drop-pending collections...
2018-01-06T14:28:51.763+0100 I REPL [initandlisten] shutdown: removing checkpointTimestamp collection...
2018-01-06T14:28:51.763+0100 I STORAGE [initandlisten] shutdown: waiting for fs preallocator...
2018-01-06T14:28:51.763+0100 I STORAGE [initandlisten] shutdown: final commit...
2018-01-06T14:28:51.770+0100 I JOURNAL [initandlisten] journalCleanup...
2018-01-06T14:28:51.770+0100 I JOURNAL [initandlisten] removeJournalFiles
2018-01-06T14:28:51.770+0100 I JOURNAL [initandlisten] old journal file will be removed: /data/db/journal/j._0
2018-01-06T14:28:51.771+0100 I JOURNAL [initandlisten] Terminating durability thread ...
2018-01-06T14:28:51.870+0100 I JOURNAL [journal writer] Journal writer thread stopped
2018-01-06T14:28:51.870+0100 I JOURNAL [durability] Durability thread stopped
2018-01-06T14:28:51.870+0100 I STORAGE [initandlisten] shutdown: closing all files...
2018-01-06T14:28:51.883+0100 I STORAGE [initandlisten] closeAllFiles() finished
2018-01-06T14:28:51.883+0100 I STORAGE [initandlisten] shutdown: removing fs lock...
2018-01-06T14:28:51.883+0100 I CONTROL [initandlisten] now exiting
2018-01-06T14:28:51.883+0100 I CONTROL [initandlisten] shutting down with code:62
Any help would be apprichiated.
2018-01-06T14:28:51.762+0100 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
This is the fault error in your log.
So I guess you have some 3.4 data in your /data/db.
If you want a clean installation, just remove the contents of /data/db and restart mongod
or
Get a 3.4 mongod
Ref: https://docs.mongodb.com/manual/release-notes/3.6-upgrade-standalone/
The error is telling you that you have mongo 3.4 data inside /data/db but you have version 3.6 of Mongo installed.
To fix this you can use one of the options listed below...
Remove the contents of /data/db and restart mongod. This should probably be backed up or you'll lose your data.
Install mongodb 3.4 you can check if you previously installed it using brew list --versions mongodb then if a 3.4.* version comes up, 3.4.10 for example use brew switch mongodb 3.4.10 to move back to that version. If you never had the version installed see this answer to install the older version Homebrew install specific version of formula?
Use #2 to move back to 3.4 then go into mongo shell using mongo and run db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } ). Exit the mongo shell and use the brew switch command to switch back to 3.6.

mongod src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp no file

I've really been all over StackOverflow on this and couldn't find a solution. I have uninstalled Homebrew and Mongo via, well, brew. Nothing seems to fix it. Any help would be much appreciated.
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] MongoDB starting : pid=7684 port=27017 dbpath=/data/db 64-bit host=Matts-MacBook-Pro.local
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] db version v3.4.6
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2l 25 May 2017
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] allocator: system
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] modules: none
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] build environment:
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] distarch: x86_64
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] target_arch: x86_64
2017-08-03T20:29:40.017-0400 I CONTROL [initandlisten] options: {}
2017-08-03T20:29:40.018-0400 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3584M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-08-03T20:29:40.019-0400 E STORAGE [initandlisten] WiredTiger error (2) [1501806580:19955][7684:0x7fffbdc783c0], file:WiredTiger.wt, connection: /data/db/WiredTiger.wt: handle-open: open: No such file or directory
2017-08-03T20:29:40.029-0400 I - [initandlisten] Assertion: 28595:2: No such file or directory src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 269
2017-08-03T20:29:40.029-0400 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating
2017-08-03T20:29:40.029-0400 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-08-03T20:29:40.029-0400 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2017-08-03T20:29:40.029-0400 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-08-03T20:29:40.029-0400 I CONTROL [initandlisten] now exiting
2017-08-03T20:29:40.029-0400 I CONTROL [initandlisten] shutting down with code:100
I also have to spent more than 4 hours to find a solution you asked. In my case, the stack trace is same as in your case.
I used MongoDB 4.2. But I need to downgrade it to MongoDB 3.4. After downgrading to 3.4 above error can be seen. Then again I updated MongoDB to 4.2. Still there was that error.
Tried many solutions on Stack Overflow but nothing solved my issue. As my final option I run below command.
mongod --dbpath /data/db --repair
But it also did not work.
There were some files on my /data/db directory.
Those are WiredTiger, WiredTiger.lock, WiredTiger.turtle, diagnostic.data, journal and mongod.lock.
Removed all the files in /data/db directory.
rm -rf /data/db/*
Run above command with sudo if you are not the root user.
Then I run mongod --dbpath /data/db --repair command again.
Then I could start MongoDB successfully by running mongod --dbpath /data/db.
Do not forget add bin/mongod to PATH in .bash_profile(If you are using Mac).

changing mongod dbpath raise permission error

I needed more space on my mongo database so I went to my local computer shop, bought a new hard drive, installed it. Then I copied all the files from /var/lib/mongodb to /media/didier/mongodb/mongodb/ and changed the ownership of /media/didier/mongodb/mongodb/ with the command sudo chown -R mongodb:mongodb /media/didier/mongodb/mongodb/. Then, I changed the config file at /etc/mongod.conf to point to the good data directory. Basically, I followed the instruction at Changing MongoDB data store directory.
The permissions looks good, the config file looks fine too, but when I start mongodb using sudo service mongod start I have the following exception in my logs
014-07-16T09:11:37.362-0400 [initandlisten] MongoDB starting : pid=5899 port=27017
dbpath=/media/didier/mongodb/mongodb/ 64-bit host=miaou
2014-07-16T09:11:37.362-0400 [initandlisten] db version v2.6.3
2014-07-16T09:11:37.362-0400 [initandlisten] git version: 255f67a66f9603c59380b2a389e386910bbb52cb
2014-07-16T09:11:37.362-0400 [initandlisten] build info: Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-07-16T09:11:37.362-0400 [initandlisten] allocator: tcmalloc
2014-07-16T09:11:37.362-0400 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/media/didier/mongodb/mongodb/" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2014-07-16T09:11:37.362-0400 [initandlisten] exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/media/didier/mongodb/mongodb/", terminating
2014-07-16T09:11:37.362-0400 [initandlisten] dbexit:
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: going to close listening sockets...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: going to flush diaglog...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: going to close sockets...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: waiting for fs preallocator...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: lock for final commit...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: final commit...
2014-07-16T09:11:37.362-0400 [initandlisten] shutdown: closing all files...
2014-07-16T09:11:37.362-0400 [initandlisten] closeAllFiles() finished
2014-07-16T09:11:37.362-0400 [initandlisten] dbexit: really exiting now
Any idea what goes wrong? When I simply run sudo mongod --config /etc/mongod.conf everything works fine. So I suppose it is a permission problem.
cheers!
The problem is that the hard drive is not accessible to the mongodb user. To share a hard drive between all users, you need to change the /etc/fstab by adding the following line:
UUID=a43bc179-f0e5-464b-bd77-1be6a7581ec2 /media/mongodb ext4 defaults 0 0
That will mount the hard drive to the /media/mongodb directory at boot time. See https://help.ubuntu.com/community/Fstab for more information.
In short, to use a different hard drive as data location on mongodb on a ubuntu machine one needs to do the following three steps:
make sure the mongodb user can access the new hard drive (fstab)
make sure the user mongodb has access to the data directory (chown)
change the mongo config file (/etc/mongod.conf)
I think the issue is you need to change permissions of your /media mount point to have r+x (read and execute) for 'other' groups and users; at least that fixed it for me. Doing
sudo chmod a+rx /media
will do it. You want to make sure this is also true for the whole path to the mongodb data I think, so you could do sudo chmod -R a+rx /media to make it recursive, or change the permissions for the drive, then each subfolder up to the mongodb folder:
sudo chmod a+rx /media/didier
sudo chmod a+rx /media/didier/mongodb
sudo chmod a+rx /media/didier/mongodb/mongodb