parse-server: MongoError: Transaction numbers are only allowed on storage engines that support document-level locking
I updated my parse server installation to version 3.8.0. I first got this error in the logs:
MongoError: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
This was of course an easy fix and the error went away after adding the option to my connection string.
Now I see another error for queries to the database:
2019-08-27T07:44:31.538322+00:00 app[web.1]: MongoError: Transaction numbers are only allowed on storage engines that support document-level locking
2019-08-27T07:44:31.538354+00:00 app[web.1]: at Connection.<anonymous> (/app/node_modules/mongodb/lib/core/connection/pool.js:466:61)
2019-08-27T07:44:31.538359+00:00 app[web.1]: at emitTwo (events.js:126:13)
2019-08-27T07:44:31.538360+00:00 app[web.1]: at Connection.emit (events.js:214:7)
2019-08-27T07:44:31.538361+00:00 app[web.1]: at processMessage (/app/node_modules/mongodb/lib/core/connection/connection.js:364:10)
2019-08-27T07:44:31.538362+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb/lib/core/connection/connection.js:533:15)
2019-08-27T07:44:31.538363+00:00 app[web.1]: at emitOne (events.js:116:13)
2019-08-27T07:44:31.538364+00:00 app[web.1]: at Socket.emit (events.js:211:7)
2019-08-27T07:44:31.538365+00:00 app[web.1]: at addChunk (_stream_readable.js:263:12)
2019-08-27T07:44:31.538369+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:250:11)
2019-08-27T07:44:31.538370+00:00 app[web.1]: at Socket.Readable.push (_stream_readable.js:208:10)
2019-08-27T07:44:31.538371+00:00 app[web.1]: at TCP.onread (net.js:601:20)
I tried to find information on this issue myself and I think this is caused by my older MongoDB Server version. It currently runs 3.6.11 which does not support this feature.
I have not seen this issue on older releases of parse server. Any other config I need to change to make this work? Or is MongoDB 4 required for parse server now?
-
Server
- parse-server version:
3.8.0 - Operating System:
heroku-18stack - Localhost or remote server?
Heroku
- parse-server version:
-
Database
- MongoDB version:
3.6.11 - Localhost or remote server?
mlab
- MongoDB version:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (14 by maintainers)
Commits related to this issue
- added breaking change note to 3.8 release Breaking change as described here: https://github.com/parse-community/parse-server/issues/5983#issuecomment-527693465 — committed to mtrezza/parse-server by mtrezza 5 years ago
- added breaking change note to 3.8 release (#6023) Breaking change as described here: https://github.com/parse-community/parse-server/issues/5983#issuecomment-527693465 — committed to parse-community/parse-server by mtrezza 5 years ago
- added breaking change note to 3.8 release (#6023) Breaking change as described here: https://github.com/parse-community/parse-server/issues/5983#issuecomment-527693465 — committed to UnderratedDev/parse-server by mtrezza 5 years ago
- add retrywrites=false to please mLab mongodb. https://github.com/parse-community/parse-server/issues/5983 — committed to SebastianAigner/vollstapel by SebastianAigner 4 years ago
+1 I had this error until I added
retryWrites=falseto my database uri.I feel very bad right now because I made an obvious mistake!
I appended
?retryWrites=falseto the URI. However this is wrong as there is already thereplicaSetparameter and therefore I need to append&retryWrites=falseto make it work correctly.So this is how it looks right now:
[...]?replicaSet=rs-ds00000?retryWrites=falseWorking perfectly without any errors.
Thanks for all your help and patience.
Don’t forget to quote the URL if setting this on Heroku. So do:
with the double quotes. Otherwise the “&” will trip you up.
I’ve just taken a closer look in the MongoDB docs to understand the reasons. So let’s go:
So, yes. If you are running your Parse Server on top of a MongoDB deployment which does not fit the Retryable Writes Requirements, you will have to add
retryWrites=falseto your connection string in order to upgrade to Parse Server 3.8.@mtrezza I think it is worth to mention that in the release notes. Do you want to open a PR with this?
you could paste it here for us to dissect - take care to remove the hostname and authorisation details like so:
mongodb://xx:xx@xx.com:33427,xx.com:33427/database-name?replicaSet=rs-xx&ssl=true&retryWrites=false