I'm trying to run MongoDB on OSX and encountering a common problem, Error with exit code 1.
Here's my very simple mongod.conf:
systemLog:
destination: file
logAppend: true
path: ~/Documents/test/mongodb/mongodb.log
storage:
directoryPerDB: true
dbPath: ~/Documents/test/mongodb/mongodb_data
journal:
enabled: true
processManagement:
fork: true # fork and run in background
net:
port: 27017
I 777'd all the folders so there's no way it can be a permissions issue (right? :P)
mac$ ls -lah ~/Documents/test/mongodb/
total 8
drwxr-xr-x 5 mac staff 170B Dec 4 15:34 .
drwxr-xr-x 11 mac staff 374B Dec 4 15:19 ..
-rwxrwxrwx 1 mac staff 301B Dec 4 15:21 mongod.conf
-rwxrwxrwx 1 mac staff 0B Dec 4 15:21 mongodb.log
drwxrwxrwx 2 mac staff 68B Dec 4 15:18 mongodb_data
But it still gets this error code!
mac$ sudo mongod -f ~/Documents/test/mongodb/mongod.conf
about to fork child process, waiting until server is ready for connections.
forked process: 70062
ERROR: child process failed, exited with error number 1
Things I've tried from other questions:
- Apparently I shouldn't have to run this as sudo (?), I've tried both sudo and no sudo, same result
- Could be a permissions issue (Starting mongod fails unless run as root) - well the mongodb_data directory and the conf and log are all 777 so can that really be the case? I've tried
chown
on all of them too but no effect. - Remove the pid location in your mongod.conf (done, doesn't have any effect) Starting mongod fork, ERROR: child process failed, exited with error number 1
Also:
- mongodb.log has nothing in it after multiple start attempts
- mongodb_data/ has nothing in it either (no .lock file or whatever, just empty)
Any ideas?