Cannot continue txnId A for session with txnId B

MongoDB version: 4.2
Go MongoDriver version: 1.4.3
Go version: 1.13

Recently started see this error pop up

(NoSuchTransaction) cannot continue txnId 4 for session 6022a452-72de-46c6-afa6-fe9247ed38c9 - 
47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= with txnId 13

I noticed from Product Considerations that this error can occur when using a driver that doesn’t support 4.2 against a 4.2 Mongos, but driver v1.4.3 supports 4.2.
I’ve verified my code isn’t starting new transactions over an existing session.

My next step is upgrading my driver to latest, which certainly might fix it, but I want to cover my bases by posting here as well.

What are the possible causes of this error beyond driver/db mismatch?

Hi Brian!
Thanks for reporting this issue. Are you running with multiple mongos instances? My initial instinct is that there’s a driver bug where we’re sending the transaction to the wrong mongos, but its hard to tell without more information.
Can you give any more information about how you got this error? Preferably a minimal reproducible example, but any information is helpful.

1 Like