MongoDB died today CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position
-
Hi,
today I had problem with nodebb + mongodb
uncaughtException: PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257) MongoError: PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257) at Function.MongoError.create (/var/www/nodebb/node_modules/mongodb-core/lib/error.js:31:11) at /var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:497:72 at authenticateStragglers (/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:443:16) at Connection.messageHandler (/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:477:5) at Socket.<anonymous> (/var/www/nodebb/node_modules/mongodb-core/lib/connection/connection.js:363:20) at Socket.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) {"error":{"name":"MongoError","message":"PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257)","ok":0,"errmsg":"PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257)","code":175,"codeName":"QueryPlanKilled"},"stack":"MongoError: PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257)\n at Function.MongoError.create (/var/www/nodebb/node_modules/mongodb-core/lib/error.js:31:11)\n at /var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:497:72\n at authenticateStragglers (/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:443:16)\n at Connection.messageHandler (/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js:477:5)\n at Socket.<anonymous> (/var/www/nodebb/node_modules/mongodb-core/lib/connection/connection.js:363:20)\n at Socket.emit (events.js:198:13)\n at addChunk (_stream_readable.js:288:12)\n at readableAddChunk (_stream_readable.js:269:11)\n at Socket.Readable.push (_stream_readable.js:224:10)\n at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)","exception":true,"date":"Fri Apr 24 2020 14:27:35 GMT+0200 (Central European Summer Time)","process":{"pid":22780,"uid":0,"gid":0,"cwd":"/var/www/nodebb","execPath":"/usr/bin/node","version":"v10.20.1","argv":["/usr/bin/node","/var/www/nodebb/app.js"],"memoryUsage":{"rss":231395328,"heapTotal":175448064,"heapUsed":113421760,"external":55057231}},"os":{"loadavg":[0.77294921875,0.34228515625,0.1728515625],"uptime":2431380},"trace":[{"column":11,"file":"/var/www/nodebb/node_modules/mongodb-core/lib/error.js","function":"Function.MongoError.create","line":31,"method":"create","native":false},{"column":72,"file":"/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js","function":null,"line":497,"method":null,"native":false},{"column":16,"file":"/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js","function":"authenticateStragglers","line":443,"method":null,"native":false},{"column":5,"file":"/var/www/nodebb/node_modules/mongodb-core/lib/connection/pool.js","function":"Connection.messageHandler","line":477,"method":"messageHandler","native":false},{"column":20,"file":"/var/www/nodebb/node_modules/mongodb-core/lib/connection/connection.js","function":null,"line":363,"method":null,"native":false},{"column":13,"file":"events.js","function":"Socket.emit","line":198,"method":"emit","native":false},{"column":12,"file":"_stream_readable.js","function":"addChunk","line":288,"method":null,"native":false},{"column":11,"file":"_stream_readable.js","function":"readableAddChunk","line":269,"method":null,"native":false},{"column":10,"file":"_stream_readable.js","function":"Socket.Readable.push","line":224,"method":"push","native":false},{"column":17,"file":"internal/stream_base_commons.js","function":"TCP.onStreamRead [as onread]","line":94,"method":"onStreamRead [as onread]","native":false}]} 2020-04-24T12:27:35.431Z [4567/22780] - error: PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257) {"name":"MongoError","ok":0,"errmsg":"PlanExecutor killed: CappedPositionLost: CollectionScan died due to failure to restore tailable cursor position. Last seen record id: RecordId(11018257)","code":175,"codeName":"QueryPlanKilled"}
anyone knows why this occured ?
thanks! -
What version of MongoDB are you using? (you can check using
mongod --version
) And are you perhaps using a replica set?Because it seems like there was an issue with 3.6.0-3.7.1 that was resolved in 3.6.3 and 3.7.2 (https://jira.mongodb.org/browse/SERVER-32606) - it caused this error.
If you're using a newer version of MongoDB and are using a replica set it's possible that this issue was caused by oplog being too small.
If that's not the case either, and you're using MongoDB >3.7.2 and not using any replication, then my knowledge from free (for students) MongoDB University courses isn't enough to help you
-
I have 3.63., I will try to update to 3.7.2 then thanks
-
ok problem was because of global chat plugin..
but heh I have running forum on mongo 4.0.14