To investigate while MongoDB service was failing to respond on MacOS, I checked the status of the service:
brew services list
| Name | Status | User | File |
| mongodb-community | error 62 | me | ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist |
I thus stopped the service
brew services stop mongodb-community
Then restarted it in verbose mode:
brew services start mongodb-community --verbose
==> Generated service file for mongodb-community: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>homebrew.mxcl.mongodb-community</string> <key>ProgramArguments</key> <array> <string>/opt/homebrew/opt/mongodb-community/bin/mongod</string> <string>--config</string> <string>/opt/homebrew/etc/mongod.conf</string> [...]
This gave me the path to mongo conf, which I read
cat /opt/homebrew/etc/mongod.conf
systemLog: destination: file path: /opt/homebrew/var/log/mongodb/mongo.log logAppend: true
I could then check the errors encountered while mongo was trying to start:
tail -n 100 /opt/homebrew/var/log/mongodb/mongo.log
In my case, it was clearly due to a version problem:
{ "t": { "$date": "2025-08-28T14:31:48.133+02:00" }, "s": "F", "c": "CONTROL", "id": 20573, "ctx": "initandlisten", "msg": "Wrong mongod version", "attr": { "error": "UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"7.0\" }. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '7.0'. Expected one of the following versions: ''8.2', '8.1', '8.0'. See https://docs.mongodb.com/master/release-notes/8.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 8.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/8.0/#upgrade-procedures." } }
A few lines on upgrading from 7.0 to 8.0:
brew services stop [email protected] brew uninstall [email protected] brew install [email protected] brew services start [email protected] mongosh
Then in mongoshell:
use admin db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
which gives me
{ featureCompatibilityVersion: { version: '7.0' }, ok: 1 }
I thus set version to 8
db.adminCommand({ setFeatureCompatibilityVersion: "8.0" })
{ "ok" : 1 }
and checked:
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
{ "featureCompatibilityVersion" : { "version" : "8.0" }, "ok" : 1 }
db.version()
8.0.13
Then 8.0 to 8.2 First, quit mongosh: we'll upgrade mongo
brew unpin [email protected] brew services stop mongodb-community brew services stop [email protected] brew services stop [email protected] rm ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist rm ~/Library/LaunchAgents/[email protected] 2>/dev/null brew reinstall mongodb-community brew services start mongodb-community brew services list
You should now have something like:
| Name | Status | User | File |
| mongodb-community | started | me | ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist |
mongod --dbpath ...Invalid command: —-dbpathmongoshell.