MongoError: exception: chunks out of order
Your Rocket.Chat version: 0.36 MongoDB shell version: 3.0.11
After an upgrade in our test env, we're seeing regular restarts with "chunks out of order" failures. Anyone know what this is or how to fix it?
Using GridFS for Avatar storage
➔ System ➔ startup
➔ +----------------------------------------------------+
➔ | SERVER RUNNING |
➔ +----------------------------------------------------+
➔ | |
➔ | Version: 0.36.0 |
➔ | Process Port: 3001 |
➔ | Site URL: https://pvlchi6urocketc1.peak6.net |
➔ | |
➔ +----------------------------------------------------+
/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
MongoError: exception: chunks out of order
at Object.toError (/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
at /root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1196:31
at /root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1905:9
at Server.Base._callHandler (/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at /root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:488:18
at [object Object].MongoReply.parseBody (/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object].<anonymous> (/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:446:20)
at [object Object].emit (events.js:95:17)
at [object Object].<anonymous> (/root/Rocket.Chat-0.36.0/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)
error: Forever detected script exited with code: 8
error: Script restart attempt #33
Updating process.env.MAIL_URL
Updating process.env.MAIL_URL
{"line":"114","file":"migrations.js","message":"Migrations: Not migrating, already at version 55","time":{"$date":1470403710347},"level":"info"}
Updating process.env.MAIL_URL
Can you give me the MongoDB version, not just the MongoDB shell version?
And can you take a look at MongoDB logs?
@codyaray seems like a DB problem: https://github.com/aheckmann/gridfs-stream/issues/48
I'm seeing the same issue, but only when mongo is setup in a replicaset with multiple nodes - 3 nodes or 2 nodes + arb. A single node replica set is ok. Here's what in the mongo log at the time I see the MongoError: exception, nothing before/after and probably what you might expect given the MongoError
2016-08-04T18:10:36.886-0500 [conn7119] should have chunk: 1 have:0
2016-08-04T18:10:36.989-0500 [conn7219] should have chunk: 1 have:0
2016-08-04T18:10:36.996-0500 [conn7189] should have chunk: 1 have:0
2016-08-04T18:10:37.091-0500 [conn7183] should have chunk: 1 have:0
I'm running MongoDB 2.6.11 and this started happening when I added nodes to a replica set.
Can you try to upgrade MongoDB to the latest stable version?
Upgraded mongo to 3.2.9 and this did not help. Also tested with RC release 0.37.1 and broken as well:
/root/Rocket.Chat-0.37.1/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
MongoError: chunks out of order
at Object.toError (/root/Rocket.Chat-0.37.1/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
at /root/Rocket.Chat-0.37.1/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1196:31
at /root/Rocket.Chat-0.37.1/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1905:9
(@adesimonepeak6 is working on this for us now. :))
FYI, still seeing the issue in 0.39.0 as well
I'm seeing this as well. Mongod version 3.2.8
Seems like this issue is related to GridFS. I disabled using GridFS for attachment & avatar storage for now. So far the instance has been stable for the last few hours.
@adesimonepeak6 Thanks for the update! Let me know if you still get an error with GridFS disabled.
I only have this issue when running rocket.chat on multiple servers at this time and that's a not a strict requirement for me. I did a mongodump and mongorestore but otherwise nothing has changed (2 data nodes and arbiter.) This is on rocket.chat 0.37.1 - 0.39.0.
I could disable GridFS since that's clearly the root cause, but that kind of kills any semblance of HA (I would need to implement HA NFS or perhaps some sort of lsync between the active/backup node for avatars and attachments.)
Our Rocket.Chat instance has crashed 3 times TODAY with this error. What seems to be happening is that certain files exist in the avatars, assets, and rocketchat_uploads .files collections, but do not exist in the corresponding .chunks collections. Deleting the ones that exist in one place and not the other gets the server to start, but ... it crashes again as soon as the data gets corrupted again, which is happening like every hour.
This is a total show-stopper. Time to move to Slack, I guess.
We're on MongoDB v3.2.10 (WiredTiger), FWIW.
Ran into this bug again today. I disabled avatar storage in gridfs and I'm seeing far fewer of these exceptions in the logs. Avatars still aren't showing up though, just the default of user-initials.
(We're using LDAP so avatars refresh periodically, might affect the issue with gridfs storage)
EDIT: after restarting all the processes with avatar gridfs storage disabled, I'm not seeing anymore errors
@codyaray when you switch storage options, the avatar ar not moved from one to the other (yet). What version of the server are you using now?
@jeffreywescott can you help us fix this with more into about your deployment? That is how we make open source become better to compete with proprietary solutions :)
This does not seem to be an issue specific to Rocket.Chat:
https://jira.mongodb.org/browse/NODE-281
@engelgabriel that link you posted relates to MongoDB version 1.4, and has status CLOSED.
Also worth noting: "In MongoDB, use GridFS for storing files larger than 16 MB." Avatars definitely do not fit the bill here.
As for our deployment, we are on MongoDB 3.2.10, hosted by compose.io. We are using the WiredTiger storage engine and have OpLog tailing enabled.
Good luck!
Did something get fixed? Why is this closed?
@jeffreywescott I thought it was fixed with the driver update done on Meteor. Are you still seeing the error on the version 0.51.0?
I'm seeing the error on 0.51.0 still, but it doesn't cause a crash anymore, it seems to handle the exception and keep going. This issue milestone shows version is 0.52.0 though?