Hi, hoping I can get some help with this…

I have tried everything, but when I run “brew services”, I get an error, it tells me that my mongodb-community has an error status with code 15872. I’ve tried reinstalling, deleting “/tmp/mongodb-27017.sock” and reinstalling, deleting cached files…I’m not sure what else to do.

Any help would be greatly appreciated!

Thank you

3 Likes

I got a same error. Have you fixed it?

Macbook Pro M1, with home-brew

Hello. Same problem here. Macbook Pro M1.
Have you found any solution to your issue?

1 Like

I have got the same issues and tried all solutions and still facing the same issue.

I encountered this error after trying to upgrade my dev mongod from 4.2 to 6.0 using Homebrew. Went through many many iterations of uninstall, reinstall, tracking down misc files to remove, restarting, etc. After many hours and troubleshooting with ChatGPT, the following worked for me.

Turned on live log:
tail -f $(brew --prefix)/var/log/mongodb/mongo.log

which surfaced this error:

"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "4.2" }.

ChatGPT suggested a scaled upgrade from 1 version to next, setting the featureCompatibilityVersion with each step.

Since this is a dev box, I went with the nuclear option instead. I didn’t even realize there were still 4.2 files lingering out there.

1 - First, stop any running MongoDB services:
brew services stop mongodb-community@5.0

2 - Delete the MongoDB database files and log files:
rm -rf $(brew --prefix)/var/mongodb/*
rm -rf $(brew --prefix)/var/log/mongodb/*

3 - Switch back to MongoDB 6.0:
brew uninstall mongodb-community@5.0
brew install mongodb-community@6.0

4 - Start fresh with 6.0:
brew services start mongodb-community@6.0

And it worked!

3 Likes