We have upgraded the Mongo db from 3.2->3.4->3.6->4.0.27 after that we are facing issue when we are trying to start the database using “systemctl” it is giveing us some error and service is not starting but when we are using “mongod --replSet “rs0” --bind_ip 0.0.0.0” command, we can see the data base is running and it’s also successfully attached in replica set, also we are able to access the mongo console.
There are three node in the replica set and mentioned issue is occurring in the secondary node.
Pasting the error below:
2021-11-16T19:35:06.723+0000 F REPL [repl writer worker 0] writer worker caught exception: BadValue: Invalid value for version, found 3.2, expected '4.0' or '3.6'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "3.2" }. See . on: { op: "u", ns: "admin.system.version", o: { _id: "featureCompatibilityVersion", version: "3.2" }, o2: { _id: "featureCompatibilityVersion" }, ts: Timestamp(1636726345, 1), t: 1, h: -4488578241200778356, v: 2 }
2021-11-16T19:35:06.723+0000 F REPL [initandlisten] Failed to apply batch of operations. Number of operations in batch: 1. First operation: { op: "u", ns: "admin.system.version", o: { _id: "featureCompatibilityVersion", version: "3.2" }, o2: { _id: "featureCompatibilityVersion" }, ts: Timestamp(1636726345, 1), t: 1, h: -4488578241200778356, v: 2 }. Last operation: { op: "u", ns: "admin.system.version", o: { _id: "featureCompatibilityVersion", version: "3.2" }, o2: { _id: "featureCompatibilityVersion" }, ts: Timestamp(1636726345, 1), t: 1, h: -4488578241200778356, v: 2 }. Oplog application failed in writer thread 8: BadValue: Invalid value for version, found 3.2, expected '4.0' or '3.6'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "3.2" }. See http://dochub.mongodb.org/core/4.0-feature-compatibility.
2021-11-16T19:35:06.723+0000 F REPL [initandlisten] Caught exception during replication recovery: BadValue: Invalid value for version, found 3.2, expected '4.0' or '3.6'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "3.2" }.
2021-11-16T19:35:06.723+0000 F - [initandlisten] terminate() called. An exception is active; attempting to gather more information
2021-11-16T19:35:06.732+0000 F - [initandlisten] DBException::toString(): BadValue: Invalid value for version, found 3.2, expected '4.0' or '3.6'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "3.2" }.
Actual exception type: mongo::error_details::ExceptionForImpl<(mongo::ErrorCodes::Error)2, mongo::AssertionException>
0x561302f9c541 0x561302f9bf25 0x5613030913a6 0x5613030913f1 0x5613017ed50c 0x56130182ab05 0x56130182b4f7 0x56130154552c 0x5613015477bb 0x5613014d3669 0x7f1563c99840 0x561301541d59*
Thanks,
Adway Deshpande