Hello.
Just upgraded MongoDB on macOS Big Sur from v4 to v5 and now I can’t connect to MongoDB. Got following issue:
MongoDB shell version v5.0.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:372:17
@(connect):2:6
exception: connect failed
exiting with code 1
I use brew. Also, from the logs I see:
“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: "4.2" }
docs.mongodb.com/v5.0/release-notes/4.4/#upgrade-procedures doesn’t help for me as even MongoDB is not running.
Running in terminal: ps -ef | grep mongod gives a feedback that mongod is not running.
How do I change the value of featureCompatibilityVersiondocument when MongoDB is not running? I guess first would be good to resolve Connection Refused issue.
I am getting stuck now where to look. Any tip would be much appreciated.