How did you install MongoDB on your Mac? Via brew
or manually installing it?
I installed it using brew
Are you seeing any errors written to the terminal window?
The first time I run the command to start the brew service, it returns Successfully started
mongodb-community@5.0 (label: homebrew.mxcl.mongodb-community@5.0)
even though it has failed to start. On the second run it gives the following error
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/niraj/Library/LaunchAgents/homebrew.mxcl.mongodb-community@5.0.plist` exited with 5.
How are you trying to start the mongod
process?
I’m starting the process with the following command
brew services start mongodb/brew/mongodb-community@5.0
Can you run mongod --dbpath <database file path> --logpath <database log path>
from the command line without issue, or do you get an error?
I get the following output, not sure if it’s an error or not
{"t":{"$date":"2022-08-07T04:49:37.098Z"},"s":"I", "c":"CONTROL", "id":20697, "ctx":"-","msg":"Renamed existing log file","attr":{"oldLogPath":"/opt/homebrew/var/log/mongodb/mongo.log","newLogPath":"/opt/homebrew/var/log/mongodb/mongo.log.2022-08-07T04-49-37"}}
I’m assuming that your user doesn’t have permissions to write to the log, and possibly the data, files and that’s causing the issues
MongoDB was working fine before with 4.2 and yesterday when I upgrade it to 5.0 it stopped working my user. If I downgrade back to 4.2 then it’s working fine.