Invalid featureCompatibilityVersion document - Problem Re-installing MongoDB enterprise edition on Linux Mint 19.1 (Ubuntu)

Hi!

I’m working on Linux Mint 19.1
I had installed mongodb previously but it was the community edition so I decided to wipe it out and re-install community.

I stopped the service and removed everything using the following commands.

sudo systemctl stop mongodb
sudo apt purge mongodb
sudo apt autoremove

I installed all the packages in here
Ubuntu 18.04 x64

Now I my “mongod” service doesn’t want to start, or maybe it does start and shuts down itself because of an error.

I went to have a look in the log using command " /var/log/mongodb sudo vi mongod.log
" and it talks about an error with the featureCompatibilityVersion version, and it looks like it is shutting down (couldn’t find any mongod process with PID as specified in log).

What do I need to do?
It looks like I messed up everything with my re-installation.

Thanks!

2019-09-18T12:48:13.325+1000 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: BadValue: Invalid value for version, found 3.6, expected ‘4.2’ or ‘4.0’. Contents of featureCompatibilityVersion document in admin.system.version: { _id: “featureCompatibilityVersion”, version: “3.6” }. See http://dochub.mongodb.org/core/4.0-feature-compatibility.). If the current featureCompatibilityVersion is below 4.0, see the documentation on upgrading at http://dochub.mongodb.org/core/4.0-upgrade-fcv.
2019-09-18T12:48:13.325+1000 I NETWORK [initandlisten] shutdown: going to close listening sockets…
2019-09-18T12:48:13.325+1000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-09-18T12:48:13.325+1000 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2019-09-18T12:48:13.325+1000 I STORAGE [initandlisten] Deregistering all the collections
2019-09-18T12:48:13.325+1000 I STORAGE [initandlisten] Timestamp monitor shutting down
2019-09-18T12:48:13.325+1000 I STORAGE [initandlisten] WiredTigerKVEngine shutting down
2019-09-18T12:48:13.326+1000 I STORAGE [initandlisten] Shutting down session sweeper thread
2019-09-18T12:48:13.326+1000 I STORAGE [initandlisten] Finished shutting down session sweeper thread
2019-09-18T12:48:13.326+1000 I STORAGE [initandlisten] Shutting down journal flusher thread
2019-09-18T12:48:13.391+1000 I STORAGE [initandlisten] Finished shutting down journal flusher thread
2019-09-18T12:48:13.391+1000 I STORAGE [initandlisten] Shutting down checkpoint thread
2019-09-18T12:48:13.391+1000 I STORAGE [initandlisten] Finished shutting down checkpoint thread
2019-09-18T12:48:13.391+1000 I STORAGE [initandlisten] Downgrading WiredTiger datafiles.
2019-09-18T12:48:13.443+1000 I STORAGE [initandlisten] WiredTiger message [1568774893:443196][2022

Hi @Isabelle_64058,

Can you please try to set up mongo shell on your system using the steps discussed in this post?

This method has worked fine for a lot of users. However, if the issue still persists please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hey @Isabelle_64058

In addition to @Shubham_Ranjan

I had the same problem before. My issue was that I had a old version, say 3.2 of mongo which I had database files for. Then I tried to upgrade to v4.0 but could not due to the error above. This is because you have to upgrade mongo set by set and you have to set the featureCompatibilityVersion when you upgrade each time.

It is explained better in the docs here. https://docs.mongodb.com/manual/release-notes/4.0-upgrade-standalone/#upgrade-process

Therefore whatever version you first had. You will have to incrementally upgrade to the latest version of MongoDB OR if you do not care about the old database data, just clean the database directory and try again.

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#remove-data-directories

Thanks @natac13 and @Shubham_Ranjan

I will try wiping off my databases / collections first as they just were test ones to see if it helps.

:+1: