swot
swot copied to clipboard
Occasional "VersionError: No matching document found" when trying to delete topics containing subtopics
Received this in the live app when trying to delete a topic containing 4 subtopics:
2014-08-31T19:39:54.874460+00:00 heroku[router]: at=info method=DELETE path="/topics/5403752f5870060200c1afa7" host=*** request_id=b343df90-4fe3-410a-9b44-482850f31fad fwd="***" dyno=web.1 connect=0ms service=31ms status=500 bytes=752
2014-08-31T19:39:54.875594+00:00 app[web.1]: VersionError: No matching document found.
2014-08-31T19:39:54.875605+00:00 app[web.1]: at Server.Base._callHandler (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:442:41)
2014-08-31T19:39:54.875614+00:00 app[web.1]: at emit (events.js:98:17)
2014-08-31T19:39:54.875607+00:00 app[web.1]: at /app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:485:18
2014-08-31T19:39:54.875613+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:191:13)
2014-08-31T19:39:54.875611+00:00 app[web.1]: at emit (events.js:95:17)
2014-08-31T19:39:54.875601+00:00 app[web.1]: at handleSave (/app/node_modules/mongoose/lib/model.js:126:23)
2014-08-31T19:39:54.875608+00:00 app[web.1]: at MongoReply.parseBody (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
2014-08-31T19:39:54.875610+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:443:20)
2014-08-31T19:39:54.875602+00:00 app[web.1]: at /app/node_modules/mongoose/lib/utils.js:408:16
2014-08-31T19:39:54.878511+00:00 app[web.1]: DELETE /topics/5403752f5870060200c1afa7 500 31ms - 21b
2014-08-31T19:39:54.875604+00:00 app[web.1]: at /app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection/core.js:637:9
I suspect the fact that all of the topics and subtopics were created in rapid succession may have something to do with this error - maybe one save call did not finish before another one was issued.