Mongodb-community error homebrew.mxcl.mongodb-community.plist

Viewed 9732

I've been having this error while running brew services start mongodb-community

mongodb-community error   root /Library/LaunchDaemons/homebrew.mxcl.mongodb-community.plist

I have tried re installing home brew, mongodb and a slew of other solutions but nothing has worked. Any help would be appreciated, thanks!

6 Answers

Hello so running sudo brew services start mongodb-community fixed it after stopping mongodb.

I had the same issue. Finally found the error in /usr/local/var/log/mongodb/mongo.log which indicated that my database files in /usr/local/var/mongodb were too old (version 4.2) for this version of mongodb (version 4.4). Since I didn't need those files, I deleted them, and mongodb started up fine. Read your logs, they will tell you what's wrong.

Hello just debugged a similiar problem. If you attempt to run mongodb with root it shows error and the problem is likely a file permission problem.

You can confirm where (directory may vary this is the default): show mongo log with cat /usr/local/var/log/mongodb/mongo.log

You are most likely seeing a "Permission denied" error on a file. (mine was for a bunch of files).

You will need to run chown on those files:

chown -R <login> /usr/local/var/mongodb

should solve it.

You can verify by running ls -la <directory> and verifying everything is now owned by your login user.

Another reason for this error might be that you forgot to enable the backwards-incompatible features of your old version. This might happen if you updated several versions one after the other. For example, if you wanted to migrate from 3.2 to 3.6, you would have to install all intermediate versions (in this case, 3.4), and for each of them you would have to enable the "backwards-incompatible 3.4 features" before installing the next version (in this case, 3.6), using this command:

db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } ) 

(as per instructions in https://www.mongodb.com/docs/manual/release-notes/3.4-upgrade-standalone/, for example). If you forgot to do that Version 3.6 would not start, showing in the log file (/usr/local/var/log/mongodb/mongo.log) the notice "* 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."

I tried for 2 hours solving this problem. The problem was with an unexpected token in mongod.conf file, that made the mongodb-community@4.2 to not to start .

To track the issue open the .plist file look at the output log file location, you can find it after StandardErrorPath key.

Please refer https://blog.codewithdan.com/installing-mongodb-on-mac-catalina-using-homebrew/ I followed this to create a data/db folder under /System/Volumes/Data and updated the path in /usr/local/etc/mongod.conf for the variable 'dbPath:'

Make sure the user and user permissions (The user who creates this file is the same user who runs the brew service for Mongo)

Still my services haven't started. I got the error when I run 'brew services list'

Same error mentioned above on this issue.

When I checked /usr/local/var/log/mongodb/mongo.log

It Failed to unlink /tmp/mongodb-27017.sock this file.

Please refer the following link to solve this.(Just delete that .sock file)

https://www.dev2qa.com/how-to-fix-failed-to-unlink-socket-file-error-when-start-mongo-db-on-macos/

Then, I made sure the permissions for data/db are good

d-wx--x--x 3 name wheel 96 Mar 22 11:20 data

Then stopped the brew services for mongo and started again. It worked.

Related