Can't start mongodb-community@5.0 service in Apple M1

I just started using this mac mini M1, 2020 (macOs Monterey 12.5.1). I’m facing some issues trying to install the mongodb community version. First when trying to install @6.0 the “[…]/bin/mongo” was not being created so I give up and installed @5.0. The last error I’m facing is that I can’t start the mongodb service.
mongo log has this error:
“{“t”:{”$date":“2022-08-17T15:27:05.396-03: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: “6.0” }. See https://docs.mongodb.com/master/release-notes/4.4-compatibility/#feature-compatibility. :: caused by :: Invalid value for featureCompatibilityVersiondocument in admin.system.version, found 6.0, expected ‘4.4’ or ‘4.9’ or '5.0. See https://docs.mongodb.com/master/release-notes/4.4-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 4.4, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/4.4/#upgrade-procedures."}}.
Since I can’t run “mongo”, I don’t know how to set the compatibility version. Can anyone help?

Hi @Gabriel_Cardoso, it looks like you started a MongoDB version 6.0 version on your computer. Then you started a 5.0 version pointed at the same database files but as you found out that doesn’t work.

I just tried starting 6.0 using a new database path which will set the FCV to 6.0 as yours is. I then tried to start MongoDB 5.0.10 and got the same error as you are getting.

For a test, I restarted 6.0 and connected to the database with mongosh and ran db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } ). This will downgrade the FCV to 5.0 on the data files. I was then able to start the 5.0.10 version of MongoDB. Note I wouldn’t do this on any production system without MongoDB support telling me to do it, and making sure I had a solid backup/recovery plan in place before in case I needed to recover my database files. You really shouldn’t change the FCV back to a previous version except under extreme situations, and even then there could be issues that arise from doing that.

4 Likes

I reinstalled 6.0 (without uninstalling 5.0) and I think everything is working. Thanks so much for the advice @Doug_Duncan , I’ll keep that in mind as I work.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.