Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Random No user with username "username" was found!

Open waveyuk opened this issue 9 years ago • 13 comments

I am getting sporadic instances where I click on a direct message chat with a user that I have been having, and receive the above message in place of the chat. Sometimes it takes several refreshes of the web page before I can see the messages. Any idea why?

Rocket.Chat Version: 0.56.0 Running Instances: 1 DB Replicaset OpLog: Enabled Node Version: 4.8.1

waveyuk avatar Jun 14 '17 19:06 waveyuk

We have the same issue with 0.53.0.

cbanal avatar Jun 16 '17 00:06 cbanal

I had the same problem because i changed the policy for the usernames, i changed the usernames in the chat as well, and had the exact same problem. Maybe you did something similar?

1stposition-ad avatar Jun 16 '17 08:06 1stposition-ad

Hi @1stposition-ad I think it has something to do if you refresh the browser. Not quite able to pinpoint if this is definitely the issue though.

waveyuk avatar Jun 18 '17 19:06 waveyuk

Specs; RC 0.56, one instance, OpLog enabled, node version 4.5.0.

We've seen this happening too, and always with direct message rooms. Personally I've encountered this problem several times after restoring (older) browser session after switching computers, but others have mentioned that it happens with desktop clients too.

We are now testing with OpLog disabled as we don't have recollection of seeing this problem before enabling OpLog.

EDIT: We haven't seen this issue since we disabled OpLog. 5 days and counting... UPDATE: All good without OpLog. 22 days and counting.

EDIT 2017-08-22: We still haven't seen this problem again. Currently running 0.58.1. We turned OpLog back on several weeks ago and set up 5 nodes to use it. Unless the root cause has been fixed in later versions of Rocket.Chat, it may very well be so that our problem was related to service load on one node installations along with the use of OpLog.

Gummikavalier avatar Jul 05 '17 05:07 Gummikavalier

Also having this issue

Rocket.Chat Version: 0.55.0 Running Instances: 1 OpLog: Enabled Node Version: 4.8.0 Server: Ubuntu 16.04 LTS

We are using LDAP authentication to our Windows AD server, has been this way since the beginning. There have been no changes to our AD config or this user. And it has seemingly been working perfectly fine.

One user specifically is having issues chatting with various users. Command+R would usually resolve it temporarily. As the issue was specific to one user one of my sys admins deleted the problem user. We recreated the user but the issue is still persisting. And one of the users he was having chatting with consistently gets the user not found error, command+R no longer clears it even temporarily.

Our users are using the latest version of Rocket.Chat+ Electron (2.8.0) I had the problem user switch to browser after recreation and issue persist. (Issue also existed on 2.4.x and later, we recently upgraded everyone to 2.8.0)

I have tried deleting rooms between these users in the Administration > Rooms. Hiding direct messages on each users client and trying to recreate direct message. Neither improve results.

I've also tried clearing the RocketChat cache in Message > General I've also logged the problem user accounts onto different machines / browsers and it follows their accounts to different workstations they've never used before.

I did force disable OpLog and restarted R.C+ service but issue persist. I still want to try rebooting the server in full but have to do that off-hours. I do not expect that to resolve the issue. But hoping that forces a further change with the OpLog adjustment. The server has been rebooted multiple times since the user has had this issue with no clearing by-reboot. This reboot would just be first full reboot since post-OpLog setting change.

Anyone have further suggestions?

Nosferous avatar Jul 26 '17 20:07 Nosferous

We've run into this issue as well. Like Nosferous, we've been using LDAP exclusively. The issue is with one specific user who's account was deleted. Later he logged in with the same credentials, and the issue began occurring. I assume logging in with LDAP credentials re-created his rocketchat account.

Rocketchat 0.57.3 Edit: Seems to be the same issue described in https://github.com/RocketChat/Rocket.Chat/issues/1149 If I check the logs I find (where u3231 is the username): "I20170810-08:03:26.811(-5) Exception while invoking method 'createDirectMessage' MongoError: E11000 duplicate key error collection: parties.rocketchat_subscription index: u.id_1_name_1_t_1_code_1 dup key: { : "yu8qXwsmDJYE7u2mA", : "u3231", : "d", : null } at Object.Future.wait (/snap/rocketchat-server/904/node_modules/fibers/future.js:449:15) at [object Object]. (packages/meteor.js:213:24) at [object Object].MongoConnection.(anonymous function) [as update] (/snap/rocketchat-server/904/programs/server/packages/mongo.js:836:49) at Object. (packages/matb33_collection-hooks.js:504:27) at Object.collection.(anonymous function) [as update] (packages/matb33_collection-hooks.js:146:21) at [object Object].update (/snap/rocketchat-server/904/programs/server/packages/mongo.js:3899:31) at ModelsBaseDb.update (/snap/rocketchat-server/904/programs/server/packages/rocketchat_lib.js:10647:32) at ModelsBaseDb.upsert (/snap/rocketchat-server/904/programs/server/packages/rocketchat_lib.js:10722:16) at ModelSubscriptions.upsert (/snap/rocketchat-server/904/programs/server/packages/rocketchat_lib.js:4283:36) at [object Object].Meteor.methods.createDirectMessage (/snap/rocketchat-server/904/programs/server/app/app.js:6513:35) at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30) at [object Object].methodsMap.(anonymous function) (/snap/rocketchat-server/904/programs/server/packages/rocketchat_lib.js:1028:26) at maybeAuditArgumentChecks (/snap/rocketchat-server/904/programs/server/packages/ddp-server.js:1823:12) at /snap/rocketchat-server/904/programs/server/packages/ddp-server.js:905:20 at [object Object]..extend.withValue (packages/meteor.js:1122:17) at /snap/rocketchat-server/904/programs/server/packages/ddp-server.js:904:41 at [object Object]..extend.withValue (packages/meteor.js:1122:17) at /snap/rocketchat-server/904/programs/server/packages/ddp-server.js:903:46 at [object Object]..extend.protocol_handlers.method (/snap/rocketchat-server/904/programs/server/packages/ddp-server.js:876:21) at /snap/rocketchat-server/904/programs/server/packages/ddp-server.js:755:85 - - - - - at Function.MongoError.create (/snap/rocketchat-server/904/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11) at toError (/snap/rocketchat-server/904/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:114:22) at /snap/rocketchat-server/904/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1049:67 at /snap/rocketchat-server/904/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:455:18 at nextTickCallbackWith0Args (node.js:489:9) at process._tickDomainCallback (node.js:459:13) "

ghost avatar Aug 10 '17 13:08 ghost

I'm also experiencing the same problem. We're authenticating to Crowd. A user account was deleted from RC. The user then logged in to RC and we could see that the account had been re-associated to the deleted account as the avatar still existed. DM to this user fails with 'No user with username "..." was found!.

We're also on rocketchat 0.57.3

technut371 avatar Aug 10 '17 14:08 technut371

Any luck with this? Having the same issue except cause was user changing name in LDAP

wonkaba avatar Feb 15 '18 18:02 wonkaba

Rocket.Chat Version: 0.62.0 Running Instances: 1 DB Replicaset OpLog: Disabled Node Version: 8.9.4

Attempted fix: restart mongo, restart RocketChat

This started happening to multiple users this morning. We are not using any external auth, no user has changed their username (although this server does allow it). This was reported to me by a member of my community, and I was able to replicate. It seems like DMs between myself and other community members that I have not DMed with in the past days/weeks/months show this error, or show a blank DM session, whereas members that I have DMed with in the past 24 hours work fine. The message count in Admin -> Rooms for DMs where issues are reported is incorrect, showing 0 messages.

Interestingly, this seemed to start to fix itself on its own, about 15 minutes after my attempted fix. The DM session between myself and the user who initially reported this error is one of the ones that showed an empty room, instead of the username error; I tried to send several DMs to this user, and they showed up grey (indicating they were pending sending). After a few minutes, one of the test messages sent, and I was once again able to view our full conversation history. However, the DM count in Admin -> Rooms is still inaccurate, only reflecting the messages exchanged this morning. However, I am not able to replicate this fix across all my DM sessions that are currently showing this error.

I'm seeing two different stack traces with two different exceptions; both are included below.

Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: Exception while invoking method 'createDirectMessage' TypeError: Cannot read property 'push' of undefined
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseCache.processLocalJoinInserted (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:10412:28)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseCache.on.localRecord (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:10313:12)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at emitOne (events.js:121:20)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseCache.emit (events.js:211:7)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseCache.insert (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:10932:12)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseDb.model._db.on (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:10642:16)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at emitOne (events.js:116:13)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseDb.emit (events.js:211:7)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseDb.update (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:11453:18)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelsBaseDb.upsert (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:11505:17)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at ModelRooms.upsert (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:6339:21)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at MethodInvocation.createDirectMessage (/opt/rocketchat/programs/server/app/app.js:7956:29)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at MethodInvocation.methodsMap.(anonymous function) (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:2158:28)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at maybeAuditArgumentChecks (/opt/rocketchat/programs/server/packages/ddp-server.js:1877:12)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at DDP._CurrentMethodInvocation.withValue (/opt/rocketchat/programs/server/packages/ddp-server.js:902:126)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at DDPServer._CurrentWriteFence.withValue (/opt/rocketchat/programs/server/packages/ddp-server.js:902:98)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at Promise (/opt/rocketchat/programs/server/packages/ddp-server.js:902:46)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at new Promise (<anonymous>:null:null)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at Session.method (/opt/rocketchat/programs/server/packages/ddp-server.js:875:23)
Mar 07 10:11:04 server.hostname.com start_rocketchat.bash[14116]: at /opt/rocketchat/programs/server/packages/ddp-server.js:754:85
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: Exception from sub stream-notify-room id PBFxZAZortNfLccaj TypeError: Cannot read property 'indexOf' of undefined
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Subscription.<anonymous> (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:6096:29)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Streamer.isReadAllowed (/opt/rocketchat/programs/server/packages/rocketchat_streamer.js:264:39)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Subscription.<anonymous> (/opt/rocketchat/programs/server/packages/rocketchat_streamer.js:372:18)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Subscription.<anonymous> (/opt/rocketchat/programs/server/packages/rocketchat_lib.js:2177:17)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at packages/matb33_collection-hooks.js:307:21
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Subscription._handler (packages/matb33_collection-hooks.js:306:28)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at maybeAuditArgumentChecks (/opt/rocketchat/programs/server/packages/ddp-server.js:1877:12)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at DDP._CurrentPublicationInvocation.withValue (/opt/rocketchat/programs/server/packages/ddp-server.js:1188:73)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Subscription._runHandler (/opt/rocketchat/programs/server/packages/ddp-server.js:1188:51)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Session._startSubscription (/opt/rocketchat/programs/server/packages/ddp-server.js:1024:9)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at Session.sub (/opt/rocketchat/programs/server/packages/ddp-server.js:816:12)
Mar 07 10:23:15 server.hostname.com start_rocketchat.bash[10891]: at /opt/rocketchat/programs/server/packages/ddp-server.js:754:85

notnamed avatar Mar 07 '18 16:03 notnamed

I was informed that another admin had tried to delete a user without a username last night, hitting the bug fixed in https://github.com/RocketChat/Rocket.Chat/pull/9986

The solution was to upgrade to 0.62.1, delete the bugged user, restart RocketChat, and instruct affected users to reload their clients.

notnamed avatar Mar 07 '18 17:03 notnamed

Version: 0.63.2 (upgraded from 0.5 something, 0.53 would be my guess as that's what I wrote the cookbook for) Database Migration Date | Mon Apr 30 2018 20:27:55 GMT-0600 (MDT) Installed at | Fri Oct 06 2017 22:10:11 GMT-0600 (MDT) Node Version: 0.8.3 Running Instances: 1 DB Replicaset OpLog: Default? (no idea what this is, so I'm guessing it's Disabled...)

We're running into something similar I think, but it's only between one account and another.

Account A in a DM to Account B gets the "No user with username "Account B" was found!".

Account B can DM Account A and notifications pop.

Everyone else on the server can DM Account B.

I just made Account B an admin.

I just created a new account and that new account can DM Account A and Account B.

maraaaa avatar May 02 '18 00:05 maraaaa

https://github.com/RocketChat/Rocket.Chat/issues/6535

engelgabriel avatar May 05 '18 01:05 engelgabriel

Hello, I'm getting the same error in links from emails to DM in Rocket.Chat Version 3.10.5. Never experienced before, we upgraded from 2.x to 3.10 one week ago and now see the new link to go.rocket.chat which eventually redirects to our installation.

t4nec0 avatar Feb 26 '21 15:02 t4nec0