MongoDB Atlas Error while performing transaction on multiple collections (code 8000)

橙三吉。 提交于 2019-12-04 05:58:34

I had this same issue and could not solve it. I ended up creating a new cluster on Azure (instead of AWS) and it seems to be working fine.

Not sure if this is an issue with their implementation on AWS or case by case mis-configuration

Update: The same error is now happening on the new cluster. I raised a ticket and got the following response;

This has been determined to be a bug currently affecting the M0 free cluster and shared tiers of Atlas (M2 and M5). We have opened an internal bug report to address this. While the internal development queue for our Cloud products is not publicly visible, we are tracking the work required to make multi-document transactions work on Atlas free tier clusters.

They said the same thing as the other answer. Please use M10. However, M10 is about $60/m which is not quite a resolution by any means. It also completely invalidates the main selling point of them saying M0 now includes MongoDb 4.0

As mentioned in comments, according to MongoDB team this issue has been solved on version 4.0.5

I've tested the same code posted on my question and it now works fine.

For anyone facing the same issue, make sure to be using a version equal to or higher than 4.0.5.

Henry Ollarves

I was having the same issue. The Support Department said that since I was using Mongoose, they couldn't help. However, they were kind enough to gift me 10$ in credit so I could test it out with a higher tier.

That was the issue, as soon as I upgraded to M10 tier (the next one after M0) transactions started working as intended. Your code is very similar as mine, only that I was creating one document and updating 2 others at the same time. Just like in your case, the first one went through (no matter the order) and the next just timed out with the same error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!