I had a replica set running on MongoDB version 2.6 and upgraded to 3.6 (2.6 -> 3.0 -> 3.2 -> 3.4 -> 3.6).

The cluster is working fine for my normal operations.

"ok" : 1

I'm trying to connect a tool that's using MongoDB Java Driver and is getting this error:

Sessions are not supported by the MongoDB cluster to which this client is connected

Might be unrelated but I'm seeing this in my MongoDB server log:

2023-03-03T01:19:44.298+0000 I CONTROL  [LogicalSessionCacheReap] Sessions collection is not set up; waiting until next sessions reap interval: config.system.sessions does not exist

When searching about this error, it suggests that replica set hasn't been initialized. But I already have a replica set that I've upgraded from v2.6. I wouldn't want to re-initialize as this existing replica set is in use.

What might be the issue here? and how can I resolve it?


1 Answer 1


Did you follow all these upgrade procedures step-by-step?

Perhaps you have to wait some time between the steps to have all tasks completed.

What you can try is to drop the local database and initialize the ReplicaSet again


Then you can add again the other members, they will trigger an initial sync.

However, I guess you like to upgrade even to current MongoDB version 6.0. In this case an monogexport or mongodump and then import into a fresh MongoDB version 6.0 database would be faster and more reliable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.