When I run MongoDB, I usually start it manually (i.e. it's not part of my login startup items) and I'm good about stopping the service before I shutdown.
I recently restarted my laptop and received an error upon running:
brew services run mongodb/brew/mongodb-community
The error message reads:
Error: undefined method `plist_startup' for #<Formula mongodb-community (stable) /usr/local/Homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb>
I'm not entirely sure what happened. I haven't installed any major updates or made any modifications to my environment.
I completely uninstalled MongoDB before installing it again:
# Uninstall each component of mongodb-community...
brew uninstall mongodb/brew/mongodb-community
brew uninstall mongodb/brew/mongodb-database-tools
brew uninstall mongosh
# Reinstall all of the above...
brew install mongodb/brew/mongodb-community
mongod --version
db version v7.0.2
Build Info: {
"version": "7.0.2",
"gitVersion": "02b3c655e1302209ef046da6ba3ef6749dd0b62a",
"modules": [],
"allocator": "system",
"environment": {
"distarch": "x86_64",
"target_arch": "x86_64"
}
}
I'll be honest, sometimes on these late nights, I'm on autopilot. I may or may not have run a brew upgrade
at some point. I'll look into whether or not this happened. In the meantime, when I get the log for MongoDB in Homebrew, I don't even see a commit that would have impacted me:
brew log mongodb/brew/mongodb-community
# Yields...
commit f33a59b6642f6a9f47f84b390dd71c386998cce6
Author: Zack Winter <[email protected]>
Date: Wed Oct 4 23:24:26 2023 +0000
Update paths with mr script
commit 7f3db6dbe9231300cc61645c68686a970b575f1f
Author: Zack Winter <[email protected]>
Date: Tue Oct 3 20:00:06 2023 +0000
SERVER-80537 update formulas for 7.0.1 release
commit 5055c34131148681885ea2241abccfc603596295
Author: Alexander Neben <[email protected]>
Date: Fri Aug 18 10:54:02 2023 -0700
Recently Homebrew updated to 4.2, which changed the way it starts services. It required the mongodb formula to explicitly define a service block, even if just points to the service file.
The fix was merged in https://github.com/mongodb/homebrew-brew/commit/2d0bfe19214d1f5071decd238b29306a6e82fff2