We have a pod running a MongoDB instance. It was automatically upgraded this morning to 7.0.1 and now wont restart citing;
initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCo │
│ mpatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5. │
│ 0'; expected '6.0' or '6.3' or '7.0'
Where would I update this Compatibility version? The pod isn’t running at this point.
Or can I fix the version of MongoDB on the pod to a prior version.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Based on the output that you’ve shared it seems that MongoDB was upgraded to a newer version without the
featureCompatibilityVersion
being upgraded in stages.When upgrading MongoDB across multiple major versions, it’s recommended to upgrade one major version at a time and update the
featureCompatibilityVersion
in between.Here’s what you can do to recover:
1. Downgrade MongoDB:
First, downgrade your MongoDB to the previous stable version you were using (e.g., 5.0).
As you mentioned that it is a MongoDB pod, I would assume that you are using Kubernetes, you can change the image version in your MongoDB deployment configuration.
For instance:
After making the change, apply the updated configuration:
Once the pod is running with the downgraded version, verify that you can connect to your MongoDB instance.
2. Set the featureCompatibilityVersion:
Connect to your MongoDB instance and set the
featureCompatibilityVersion
:3. Upgrade Step-by-step:
Now, when you’re ready to upgrade:
featureCompatibilityVersion
to “6.0”.featureCompatibilityVersion
to “6.3”.featureCompatibilityVersion
to “7.0”.Always make sure to backup your data before performing any upgrade operations.
Preventing Automatic Upgrades:
To prevent unexpected upgrades in the future, always pin your MongoDB version in your Kubernetes configurations (or whatever method you use to deploy). For instance, instead of using
mongo:latest
as your image, usemongo:5.0
or whatever specific version you intend to use.Let me know how it goes!
Best,
Bobby
Bump, any DO mod reading this?
Otherwise, I’ll open a new thread (with basically the same issue re-reporting)
“First, downgrade your MongoDB to the previous stable version you were using (e.g., 5.0).”
I’ve been using MongoDB in latest versions all the time. The latest update from DO broke our staging machines and I don’t know what version I should downgrade to.
I’ve tried all various older version, but none worked, meaning the K8s pod always ran into CrashLoopBackOff with the error “Wrong mongod version” … "UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion … Invalid feature compatibility version value, expected ‘5.0’ or ‘5.3’ or '6.0. … If the current featureCompatibilityVersion is below 5.0, see the documentation
I have no idea how to fix this and when an update from DO is rolled out to our prod machines they will break, as well.
For the prod deployments I tried to pin the version via image: mongo:6.0 but that lead to the same issues as with the staging machines that use latest, so I had to revert to use the latest mongo latest.
Any suggestions what to do?
Kind regards Marcel
This is one of our K8s yaml files for deployment: