2 / 3
Feb 2024

Hey guys,
I have ran into an issue using the mongodb rust crate, I want to create a session, start a transaction and commit it, however when I do it I get the following panic:

Error { kind: Command(CommandError { code: 20, code_name: "IllegalOperation", message: "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.", topology_version: None }), labels: {}, wire_version: Some(17), source: None }

In order to execute the transaction I use the following code structure:

let mut session = client.start_session(None).await.unwrap(); session.start_transaction(None).await.unwrap(); // perform a series of operations using the session session.commit_transaction().await.unwrap();

which seems to be what official crate docs tell me to do ClientSession in mongodb::sync - Rust

For the database deployment I am using just the latest mongo docker image

Could anyone point me in the right direction to solve this issue?

Thank you,
Francisco

6 months later
1 month later

I’m getting the same issue when i run the containerized version of mongo with Spring boot 3.2.x.

If i enable MongoTransactionManager, I’m getting error, This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.

Even if set retryWrites=false, still not working, looks like this property is ignored. I understand there are no replica sets, or the simple image does not support retryWrites, but why this property is not considered ?