Can't upgrade from MongoDB 3.6 to 4.2


I have a self-hosted NewsBlur instance that was cloned on March 15th (commit 8c56c6f98e767bc93d31c1c3f850bf5551b3f079) and is running MongoDB 3.6.

Today I tried to merge master (commit ed0dbd9ef84379aed4508ef0a67b412f0115ae06) where MongoDB has been updated to 4.2.

MongoDB refuses to start with the following message:

2022-05-15T10:25:32.402140000+02:00 2022-05-15T08:25:32.402+0000 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 If the current featureCompatibilityVersion is below 4.0, see the documentation on upgrading at

It seems that MongoDB has to be upgraded to 4.0 before it can be upgraded to 4.2. Do you have a suggestion for how to get past this hurdle?

Thanks for the great work by the way, I love NewsBlur, it’s exactly what I had been looking for in a self-hosted news reader!

For starters, just for now, you can edit docker-compose.yml and change mongo:4.2 to mongo:3.6 which is the only change that’s making this happen.

But the truth is that I’m going to start developing using Mongo 5.0 features, so we need to get everybody on the upgrade path.

Does mongo:4.0 work? I see the compatibility message, I wonder if we should add that as a data migration…

Ok, thanks for the tip. I was able to run 4.0, set the compatibility level to 4.0, then update to 4.2. In the process though something has disturbed feed fetching - I’m getting “No feeds to queue! Exiting…”. Running Feed.drain_task_feeds() didn’t help.

Nevermind, my feeds have started updating, everything’s good. Thanks again!