{"action":"created","issue":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/6535","repository_url":"https://api.github.com/repos/RocketChat/Rocket.Chat","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/6535/labels{/name}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/6535/comments","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/6535/events","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/6535","id":218196631,"number":6535,"title":"Re:Deleting a user doesn't delete it's records from a rocketchat_subscription collection and potentially can cause MongoError: E11000 duplicate key error index","user":{"login":"12test12","id":23378492,"avatar_url":"https://avatars2.githubusercontent.com/u/23378492?v=4","gravatar_id":"","url":"https://api.github.com/users/12test12","html_url":"https://github.com/12test12","followers_url":"https://api.github.com/users/12test12/followers","following_url":"https://api.github.com/users/12test12/following{/other_user}","gists_url":"https://api.github.com/users/12test12/gists{/gist_id}","starred_url":"https://api.github.com/users/12test12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/12test12/subscriptions","organizations_url":"https://api.github.com/users/12test12/orgs","repos_url":"https://api.github.com/users/12test12/repos","events_url":"https://api.github.com/users/12test12/events{/privacy}","received_events_url":"https://api.github.com/users/12test12/received_events","type":"User","site_admin":false},"labels":[{"id":213300653,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/labels/type:%20bug","name":"type: bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"rodrigok","id":234261,"avatar_url":"https://avatars1.githubusercontent.com/u/234261?v=4","gravatar_id":"","url":"https://api.github.com/users/rodrigok","html_url":"https://github.com/rodrigok","followers_url":"https://api.github.com/users/rodrigok/followers","following_url":"https://api.github.com/users/rodrigok/following{/other_user}","gists_url":"https://api.github.com/users/rodrigok/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigok/subscriptions","organizations_url":"https://api.github.com/users/rodrigok/orgs","repos_url":"https://api.github.com/users/rodrigok/repos","events_url":"https://api.github.com/users/rodrigok/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigok/received_events","type":"User","site_admin":false},"assignees":[{"login":"rodrigok","id":234261,"avatar_url":"https://avatars1.githubusercontent.com/u/234261?v=4","gravatar_id":"","url":"https://api.github.com/users/rodrigok","html_url":"https://github.com/rodrigok","followers_url":"https://api.github.com/users/rodrigok/followers","following_url":"https://api.github.com/users/rodrigok/following{/other_user}","gists_url":"https://api.github.com/users/rodrigok/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigok/subscriptions","organizations_url":"https://api.github.com/users/rodrigok/orgs","repos_url":"https://api.github.com/users/rodrigok/repos","events_url":"https://api.github.com/users/rodrigok/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigok/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2017-03-30T13:27:05Z","updated_at":"2017-12-01T12:25:15Z","closed_at":null,"author_association":"NONE","body":"<!-- INSTRUCTION: Complete the information below from your Administration page -->\r\n\r\nRocket.Chat Version: 0.54.2\r\nRunning Instances: 1\r\nDB Replicaset OpLog: Disabled\r\nNode Version: 4.8.1\r\n\r\nI had the same problem like #1149.\r\n\r\nI followed **kalebwalton** solution step to solve the problem.\r\n\r\n> use mydb\r\n> db.users.find(\r\n> {\"username\":\"kwalton\"}\r\n> ) <-- just to make sure the user existed\r\n> db.users.remove(\r\n> {\"username\":\"kwalton\"}\r\n> ) <-- deletes the user\r\n> Then I re-logged in to Rocket.Chat and it worked. But I ran into another issue where I couldn't direct message someone, so I went back into mongo and:\r\n> use mydb\r\n> db.rocketchat_subscription.find({\"name\":\"kwalton\"}) <-- copied the rid value for the person and my conversation\r\n> db.rocketchat_subscription.remove({\"name\":\"kwalton\"}) <-- deletes my subscriptions\r\n> db.rocketchat_room.find({\"_id\":\"\"}) <-- just to make sure the room exists\r\n> db.rocketchat_room.remove({\"_id\":\"\"}) <-- remove the room\r\n> Also found any other rooms that matched the other person and I:\r\n> db.rocketchat_room.find({\"usernames\" : [ \"theotherperson\", \"kwalton\" ]})\r\n> db.rocketchat_room.remove({\"usernames\" : [ \"theotherperson\", \"kwalton\" ]}) <-- removed all rooms between us, appeared to be a dupe in there causing trouble\r\n\r\nBut now I have an other problem.\r\nNow it says \"No user with username was found!\" when trying to access the direct message.\r\n![issue](https://cloud.githubusercontent.com/assets/23378492/24506198/fe03f904-155c-11e7-85e8-fba71540daec.png)\r\n"},"comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments/348482050","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/6535#issuecomment-348482050","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/6535","id":348482050,"user":{"login":"cello86","id":6987539,"avatar_url":"https://avatars3.githubusercontent.com/u/6987539?v=4","gravatar_id":"","url":"https://api.github.com/users/cello86","html_url":"https://github.com/cello86","followers_url":"https://api.github.com/users/cello86/followers","following_url":"https://api.github.com/users/cello86/following{/other_user}","gists_url":"https://api.github.com/users/cello86/gists{/gist_id}","starred_url":"https://api.github.com/users/cello86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cello86/subscriptions","organizations_url":"https://api.github.com/users/cello86/orgs","repos_url":"https://api.github.com/users/cello86/repos","events_url":"https://api.github.com/users/cello86/events{/privacy}","received_events_url":"https://api.github.com/users/cello86/received_events","type":"User","site_admin":false},"created_at":"2017-12-01T12:25:15Z","updated_at":"2017-12-01T12:25:15Z","author_association":"NONE","body":"Present the issue on version 0.59.3. We have recreated a user and we noticed this issue."}}
{"actor":{"display_login":"cello86"}}