Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when editing a message that hasn't been received by the server yet #2872

Closed
lucasvanhalst opened this issue Apr 13, 2016 · 4 comments · Fixed by #14945
Closed

Exception when editing a message that hasn't been received by the server yet #2872

lucasvanhalst opened this issue Apr 13, 2016 · 4 comments · Fixed by #14945

Comments

@lucasvanhalst
Copy link
Contributor

So basically to reproduce this edge case:

  • Have slow internet (or set it to something really slow in dev tools) or have the server be slow due to it being overloaded
  • Send a message
  • Edit it (using the arrow-up shortcut) while it's not been send yet (aka it is displayed gray-ish)
  • The following error will occur:

rocketchat_1 | Exception while invoking method 'sendMessage' MongoError: E11000 duplicate key error collection: rocketchat.rocketchat_message index: id dup key: { : "8ciEoNY53oEJocvq6" }
rocketchat_1 | at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:398:15)
rocketchat_1 | at [object Object]. (packages/meteor/helpers.js:119:1)
rocketchat_1 | at [object Object].MongoConnection.(anonymous function) as insert
rocketchat_1 | at Object.CollectionHooks.defineAdvice.self (packages/matb33_collection-hooks/insert.js:48:1)
rocketchat_1 | at Object.collection.(anonymous function) as insert
rocketchat_1 | at [object Object].Mongo.Collection.(anonymous function) (packages/mongo/collection.js:590:1)
rocketchat_1 | at [object Object].Mongo.Collection.(anonymous function) as insert
rocketchat_1 | at _Class.RocketChat.models._Base._Class.insert (packages/rocketchat_lib/server/models/_Base.coffee:17:24)
rocketchat_1 | at Object.RocketChat.sendMessage (packages/rocketchat_lib/server/functions/sendMessage.coffee:24:44)
rocketchat_1 | at [object Object].Meteor.methods.sendMessage (packages/rocketchat_lib/server/methods/sendMessage.coffee:25:14)
rocketchat_1 | - - - - -
rocketchat_1 | at Object.toError (/app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
rocketchat_1 | at /app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/collection/core.js:116:29
rocketchat_1 | at /app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1197:7
rocketchat_1 | at /app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/db.js:1905:9
rocketchat_1 | at Server.Base._callHandler (/app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
rocketchat_1 | at /app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:488:18
rocketchat_1 | at [object Object].MongoReply.parseBody (/app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
rocketchat_1 | at [object Object]. (/app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:446:20)
rocketchat_1 | at [object Object].emit (events.js:95:17)
rocketchat_1 | at [object Object]. (/app/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)

Version 0.26

@TheReal1604
Copy link
Contributor

@engelgabriel this should be a bit more prioritized?

@Hudell
Copy link
Contributor

Hudell commented Apr 17, 2018

This is an old issue that seems to have been fixed already. I'll be closing it for now, but if anybody runs into this problem again, you're free to open an issue again.

@Hudell Hudell closed this as completed Apr 17, 2018
@theorenck theorenck removed this from the Short-term milestone Apr 25, 2018
@XshzX
Copy link

XshzX commented Jul 11, 2018

I got this error after 2 years.

Rocketchat Config:
Rocketchat Docker image 0.66.0
MongoDB Docker image: mongo:3.6.5

7/11/2018 10:39:32 AMException while invoking method 'sendMessage' WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: rocketchat.rocketchat_message index: id dup key: { : "xMa6cBQDNSjBtHEMu" }","op":{"_id":"xMa6cBQDNSjBtHEMu","rid":"e59AEf8ehvrP6sKGsw9zxAmA7u5ykZmcbK","msg":"heello, how are you","ts":"2018-07-11T08:39:32.496Z","u":{"_id":"e59AEf8ehvrP6sKGs","username":"john.john","name":"John John"},"mentions":[],"channels":[],"_updatedAt":"2018-07-11T08:39:32.498Z"}})
7/11/2018 10:39:32 AM at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
7/11/2018 10:39:32 AM at toError (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22)
7/11/2018 10:39:32 AM at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:668:23
7/11/2018 10:39:32 AM at handleCallback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:120:56)
7/11/2018 10:39:32 AM at resultHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/bulk/ordered.js:421:14)
7/11/2018 10:39:32 AM at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
7/11/2018 10:39:32 AM at _combinedTickCallback (internal/process/next_tick.js:131:7)
7/11/2018 10:39:32 AM at process._tickDomainCallback (internal/process/next_tick.js:218:9)

@Hudell Hudell reopened this Jul 11, 2018
@XshzX
Copy link

XshzX commented Jul 18, 2018

it come to my attention that this happens just when the container is unexpectedly restarted by rancher ,the clients get disconnected and the connect again as soon the rocket.chat runs again. It might just be that this caused the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants